Simulate robot on grid with obstacles | Uber Interview Question