Search
⌘K

Leetcode 657. Robot Return to Origin

Determine whether a sequence of moves ('U','D','L','R') returns a robot to the origin by checking that the net horizontal and vertical displacements cancel out (i.e., counts of 'L' vs 'R' and 'U' vs 'D' are equal).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.