Axon interview question

The question was a code problem that could be solved by a breadth first search.