Photo by Nacho Capelo on Unsplash2037. Minimum Number of Moves to Seat EveryoneTapan Rachchh·Jun 13, 2024·1 min readclass Solution: def minMovesToSeat(self, seats: List[int], students: List[int]) -> int: seats.sort() students.sort() diff = 0 for i in range(len(seats)): diff += abs(seats[i] - students[i]) return diff Pythonleetcodesorting Share this