Total refactoring of CheckIfAnyExit() using recursive method to check all possible ways out of the labyrinth.