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.
List isn't an appropriate data structure for this task.
This bad choice leads to O(n ^ 2) time complexity.
Because with ArrayList list removal is an O(n) operation and if you peek LinkedList instead, then access to the arbitrary will cost O(n).
A double-ended queue is a better candidate for this job.
Fixed.
You can call remove(i) twice instead. Also, your i doesn't have to go back to the start, it only needs to go back 1 position, for N W E S cases.
This comment is hidden because it contains spoiler information about the solution
Would recommend updating discription to say throw IllegalArgumentException instead of return false.