2037. Minimum Number of Moves to Seat Everyone

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2037

class Solution:
    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:
        seats.sort()
        students.sort()
        return sum(abs(a - b) for a, b in zip(seats, students))