Python | Easy
see the Successfully Accepted Submission\n\n# Code\n\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n        # So
[see the Successfully Accepted Submission](https://leetcode.com/problems/minimum-number-of-moves-to-seat-everyone/submissions/1286799472/?envType=daily-question&envId=2024-06-13)\n\n# Code\n```\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n        # Sort both arrays\n        seats.sort()\n        students.sort()\n        \n        # Initialize the total moves counter\n        total_moves = 0\n        \n        # Calculate the total number of moves required\n        for i in range(len(seats)):\n            total_moves += abs(seats[i] - students[i])\n        \n        return total_moves\n\n```\n![image](https://assets.leetcode.com/users/images/b1e4af48-4da1-486c-bc97-b11ae02febd0_1696186577.992237.jpeg)
['Python3']