Easy Python Solution That Beats 99% of Runtimes!
Intuition\n Describe your first thoughts on how to solve this problem. \nThe minimum number of moves that can be achieved, can be found by sorting the two lists
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe minimum number of moves that can be achieved, can be found by sorting the two lists, and taking the absolute value difference of each value at an index, and summing that up. \n\nFor example,   `seats = [1, 4, 3]` and `students = [7, 4, 2]`, can be sorted to be `[1, 3, 4]` and `[2, 4, 7]` and now for each pair `(1,2), (3, 4), (4, 7)`, will be the smallest possible difference.\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\nSort both lists using the built-in sort() function, which is optimized. The iterate through both lists and take the absolute difference of each pair. Return the total difference. \n\nPlease upvote if you found it helpful :)\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(nlogn)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n        seats.sort()\n        students.sort()\n        count = 0\n        for i in range(len(seats)):\n            count += abs(seats[i] - students[i])\n        return count\n```
['Array', 'Greedy', 'Sorting', 'Python', 'Python3']