Available question text
Given an array containing some empty slots, find the minimum number of moves to sort the array when a move consists of taking any item and placing it into an empty position (thus creating a new empty). The core challenge is modeling the arrangement as permutation cycles and optimally using empty slots (and handling duplicates/multiple empties) to break cycles and minimize moves.
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 2459. Sort Array by Moving Items to Empty Space
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source