O(n) counting sort in Python
trivial O(nlogn) solution, using sort() w/o hesitation:\npython\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n 
trivial `O(nlogn)` solution, using `sort()` w/o hesitation:\n```python\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n        seats.sort()\n        students.sort()\n        return sum(abs(seat - student) for seat, student in zip(seats, students))\n```\n`O(m+n)` solution, using counting sort where `m` and `n` are respectively the maximum digit of `students` and `seats`:\nnote that for better understanding, you may replace `i` and `j` with `student` and `seat`.\n```python\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n        seats_cnt, students_cnt = [0] * (max(seats) + 1), [0] * (max(students) + 1)\n        for seat in seats:\n            seats_cnt[seat] += 1\n        for student in students:\n            students_cnt[student] += 1\n        ans = 0\n        i = j = 1\n        while i < len(students_cnt):\n            if students_cnt[i]:\n                # find the next available seat\n                while j < len(seats_cnt) and not seats_cnt[j]:\n                    j += 1\n                ans += abs(i - j)\n                seats_cnt[j] -= 1\n                students_cnt[i] -= 1\n            else:\n                i += 1\n        return ans\n```
['Sorting', 'Counting Sort', 'Python', 'Python3']