Solved in depth first search
Worked! Passed the level :-)