Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2037. Minimum Number of Moves to Seat Everyone
Given positions of n seats and n students, minimize the total number of moves (sum of absolute position changes) to assign each student to a distinct seat; this reduces to pairing students and seats to minimize the sum of absolute differences (optimal via sorting both arrays and matching corresponding elements).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.