Xoriant interview question

Rat and maze