GoogleSoftware Engineer · OnsiteCodemia practiceFewest Moves for a Two-Cell Rover That Can Rotate in a Grid
A rover occupies two adjacent cells of an n by n grid with obstacles, starting horizontally at (0,0)-(0,1). It can shift right or down one cell if both new cells are free, rotate clockwise from horizontal to vertical if the two cells below are free, or counterclockwise from vertical to horizontal if the two cells to the right are free. Return the fewest moves to reach (n-1,n-2)-(n-1,n-1), or -1.