Amazon Interview Question

Duplicates in an array and Rat in the maze