The easiest fun O(n) time (eat seats!)
Intuition\n Describe your first thoughts on how to solve this problem. \nJust use counting sort and discover how long does it take to bring students and chairs 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nJust use counting sort and discover how long does it take to bring students and chairs to each other.\n# Approach\n<!-- Describe your approach to solving the problem. -->\n* Each student "eats" one seat.\n* If the the previous students are fed, you don\'t need to count distance.\n* If you have some empty chairs, you could feed suddenly appeared students.\n* Pass all 100 units and count how long does it take to feed suddenly appearing hungry students.\n* Yes, it\'s $$gready$$ and $$counting \\space sort$$.\n# Complexity\n- Time complexity: $$O(n)$$\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---\n* You could find some other extraordinary solutions in my [profile](https://leetcode.com/almostmonday/) on the Solutions tab (I don\'t post obvious or not interesting solutions at all.)\n* If this was helpful, please upvote so that others can see this solution too.\n---\n\n# Code\n```\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n        d = [0] * 101\n        for i in seats: d[i] += 1\n        for i in students: d[i] -= 1\n        res = s = 0\n        for x in d:\n            if s != 0: res += abs(s)\n            s += x\n        \n        return res\n```\n\nOr it could be:\n```\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n        d = [0] * 101\n        for i in seats: d[i] += 1\n        for i in students: d[i] -= 1\n        res = s = 0\n        for x in d:\n            res += abs(s)\n            s += x\n        \n        return res\n```
['Array', 'Greedy', 'Sorting', 'Counting Sort', 'Python', 'Python3']