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.
As noted below this is a regular graph reachability problem with no real performance requirements, and there're already many such katas available.
This is not the right way to explain a task.
The description obfuscates this, but it turns out this is just a generic graph search kata like countless before it.
If the point of it is to enforce solving with a specific, efficient algorithm, then the performance tests need to be much much stricter. As it stands, a standard BFS implementation solves this in ~5s.