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.
This works fine when the walk length is exactly 10 (which I appreciate is the length given in the instructions). However, it would be risky for future updates if (for example) the walk length were to be increased.
This would fail in some cases. For example, the code would accept the following as a valid walk when it is not valid: {"n","e","w","n","w","n","e","w","n","w"}
This doesn't work if there are multiple spaces between words in the phrase
For example, the string "most trees are blue" should be changed to "Most Trees Are Blue" but with this code it causes a System.IndexOutOfRangeException error.