Search
⌘K

Leetcode 1033. Moving Stones Until Consecutive

Given three distinct integer positions on a line where in each move you can relocate an endpoint stone to any unoccupied integer between the endpoints, compute the minimum and maximum number of moves to reach three consecutive positions. The answer is the pair [minMoves, maxMoves], where min is 0, 1, or 2 depending on small-gap patterns between adjacent stones and max equals the total empty slots between the outer stones.


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.