Find shortest path in a maze grid | Meta Interview Question