Easy Solutions || Begineer Friendly || Easy to understand|| Easy to Use || Brute Force
Intuition\n Describe your first thoughts on how to solve this problem. \nTo minimize the total number of moves required to seat students, each student should id
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nTo minimize the total number of moves required to seat students, each student should ideally be seated in the closest available seat. Sorting both the list of seats and the list of students ensures that each student is paired with the closest available seat, minimizing the total distance traveled.\n# Approach\n<!-- Describe your approach to solving the problem. -->\n**Sort both lists:** First, sort the seats list and the students list. Sorting helps in pairing the smallest available seat with the smallest student position, the second smallest seat with the second smallest student position, and so on.\n**Calculate the total moves:** Iterate through the sorted lists and for each pair, calculate the absolute difference between the student\'s position and the seat\'s position. Sum up all these differences to get the total number of moves required.\n# Complexity\n- Time complexity:$$O(nlogn)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n        seats.sort()\n        students.sort()\n        ans=0\n        for i in range(len(seats)):\n            ans+=abs(students[i]-seats[i])\n        return ans\n```
['Array', 'Math', 'Greedy', 'Sorting', 'Python', 'Python3']