Available question text
Given integer positions of stones, determine the minimum and maximum number of moves (each move relocates an endpoint stone to a non-endpoint spot) required to make all stones occupy consecutive integer positions. After sorting, the task reduces to sliding-window and gap analysis — min moves by packing the largest subset into a length-(n-1) interval (with one small special-case), and max moves driven by the largest outer gap.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1040. Moving Stones Until Consecutive II
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source