Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
One must simply cherish your solution soooo much! Enjoyable, elegant, briliant!
So elegant. Congratulations!
I'm in the same boat as you. I knew it could be done, but I just couldn't wrap my head around a recursive solution.
So good. How do I master the recurrrrsssiooonnn. I got as far as writing countArara(n-2) then did it w/o recursion!
Just look at my solution. I did it.
This is an issue with how JavaScript handle floats. You would have the same result when using
Math.round
:Computing accurate roundings would make an interesting kata, but here I think it is out of scope, as it would add a lot of work to handle that specific case.
Problem: Try [ [0,0] , [0,1.005] ]
It should return "1.01" but returns "1.00" instead.
This is a problem of JavaScript that was not covered in the test cases.
Check this out:
http://stackoverflow.com/questions/11832914/round-to-at-most-2-decimal-places-in-javascript
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
Wow, quite clever. I had now idea hypot existed! Well done!
so cool