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.
You report finding the needle when there is no needle...
IllegalArgumentException would be more appropos.
Either that or "not found"
Nice math. Why not just make n a long instead of an int?
Where you say "if ( kk == 1+8n ) return true; else return false;" you could simplify to "return kk == 1+8n"
Your main loop is nice. The isOpposite( ) method could use some clean up.
dist.toArray(new String[dist.size()]) would save you an allocation.
path.toArray(new String[path.size()]) would save you an allocation.
You aren't guaranteed there is only one instance of NORTH for the == test.
It looks like most of the solutions were satisfied with O(n) performance for count( ) and depth( ). It's worth the effort (not much) to improve that to O(1).
You need to test for .. instead of . to handle decimals.
Relying on the internal structure of the scales object is pure evil. Congratulations on the purity of this answer ;-)
This kata needs a better test suite. Most of the posted solutions would fail on ftp://sports.yahoo.com/somthing?unexpected=true
Not a fan of any solution that mutates input.
Your last 0* is redundant to the first one
If you use push instead of unshift and reduceRight instead of join, this will run much faster without damaging the nice code structure.
Loading more items...