✅Easy and Clean Code (C++ / Java/ JavaScript/ Python)✅✅✅
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nfirst Sort both Array. 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nfirst Sort both Array. After that substract them index wise and add in a variable.\n# Complexity\n- Time complexity: O(NlogN)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```Java []\nclass Solution {\n    public int minMovesToSeat(int[] seats, int[] students) {\n        Arrays.sort(seats);\n        Arrays.sort(students);\n\n        int cnt = 0;\n        for (int i = 0; i < seats.length; i++) {\n            cnt += Math.abs(students[i] - seats[i]);\n        }\n\n        return cnt;\n    }\n}\n```\n```C++ []\nclass Solution {\npublic:\n    int minMovesToSeat(vector<int>& seats, vector<int>& students) {\n        sort(seats.begin(), seats.end());\n        sort(students.begin(), students.end());\n\n        int cnt = 0;\n        for(int i = 0; i < seats.size(); i++) {\n            cnt += abs(students[i] - seats[i]);\n        }\n\n        return cnt;\n    }\n};\n```\n\n```javascript []\n/**\n * @param {number[]} seats\n * @param {number[]} students\n * @return {number}\n */\nvar minMovesToSeat = function(seats, students) {\n    seats.sort((a, b) => a - b);\n    students.sort((a, b) => a - b);\n\n    let cnt = 0;\n    for (let i = 0; i < seats.length; i++) {\n        cnt += Math.abs(students[i] - seats[i]);\n    }\n\n    return cnt;\n};\n\n```\n\n```python []\nclass Solution(object):\n    def minMovesToSeat(self, seats, students):\n        """\n        :type seats: List[int]\n        :type students: List[int]\n        :rtype: int\n        """\n        seats.sort()\n        students.sort()\n\n        cnt = 0\n        for seat, student in zip(seats, students):\n            cnt += abs(seat - student)\n\n        return cnt\n            ```\n\n```\n\n
['Array', 'Greedy', 'Sorting', 'Python', 'C++', 'Java', 'JavaScript']