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.
@RyanGPalmer. Yep. You got it - it was example of:
See other discourse comments here. I think other people struggled with exactly same example.
@dinglemouse I understand what you are saying but some of the examples seem to contradict this. For example:
How does this not count as ambiguous? There is a very obvious junction where you could turn either left or right. However, if you turn left, you get to a dead end. So if it's only considered "ambiguous" when both paths could possibly reach the end, then that contradicts this example:
There is no junction here where both of the two directions are valid. Thus I'm afraid I just do not understand what meets your definition of ambiguity. (By the way my code passes every test except the latter example, so perhaps its possible we can discuss that, since I have been staring for awhile and do not understand how it could be considered ambiguous. There's only one possible path backwards or forwards.)
EDIT:
Nevermind, I understand now. The first example is certainly ambiguous from one direction, but from the other direction there is no ambiguity. Thus it fits your description where paths could potentially be valid from one direction and not the other.
I'm passing 23 out of 24 tests, but failing on this one:
It's supposed to be invalid but I do not understand how this is invalid. Seems perfectly valid to me and my code agrees.
EDIT:
I understand it now, this is not valid because there are places where you could turn left or right. I had an incorrect understanding of one of the examples which lead me to a false assumption about what was considered ambiguous.
This comment is hidden because it contains spoiler information about the solution
According to the CW wiki, "Best Practices" are solutions that you would expect to see in production code. Maintainability and readability are favored over performance and elegance. Of course, in the real world, production code standards will vary. Regardless, this solution reads well, and would be easy to manage due to the granularity.
As others have stated, please indicate the sequence must also be a set. Description is incomplete without this detail.
By definition, a sequence can have repeated elements. Thus, the description of this Kata is insufficient. The best solution for a traditional sequence is to use a PriorityQueue. However, since the sequence must also be a set, a SortedSet implementation is required.