Amazon Interview Question

Rat and maze problem with traps