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.
I agree, I was able to pass the tests without fully functional code
Isnt coding about copy paste?
I actually thought of trying to implement it. Would have been a great regEx paractice, but then... as you say its so easy to google it.
Well, exactly the same way how others did it with recursion! ;) Idea is to reduce the amount of identical recursive (or any other) calls and "merge" them somehow into a single one, no matter if it's done with recursion or not.
Try to visualize the task in a cartesian coordinate system: (0,0) -> (1,0) -> (0,0) -> (-1,0) -> (-1,1) -> (-1,0) -> (0,0) -> (0,-1)
arr[0]+arr[1] eliminate each other, then arr[3]+arr[4], resulting in South (arr[2]) and North (arr [5]) being next to each other, thus annihilating each other, which means that arr[6] "West" is the only entry, which doesn't cancel anything out in our given array.
Can't be changed.