Sort
C++\ncpp\nint minMovesToSeat(vector<int>& seats, vector<int>& students) {\n    int res = 0;\n    sort(begin(seats), end(seats));\n    sort(begin(students), end(
**C++**\n```cpp\nint minMovesToSeat(vector<int>& seats, vector<int>& students) {\n    int res = 0;\n    sort(begin(seats), end(seats));\n    sort(begin(students), end(students));\n    for (int i = 0; i < seats.size(); ++i)\n        res += abs(seats[i] - students[i]);\n    return res;\n}\n```
[]