Easy_java solution with explanation
Intuition\nsorting technique\n\n# Approach\n\nif you see carefully the main approach of the question is to make the elements of array students must be equal to 
# Intuition\nsorting technique\n\n# Approach\n\nif you see carefully the main approach of the question is to make the elements of array students must be equal to the array of seats\n according to the explanation given:\nseats = [3,1,5], students = [2,7,4]\n1>if we decrese students[0] = 2 by 1 move then it will equal to 1\n2>if we decrese students[1] = 7 by 2 move then it will equal to 5\n3>if we decrese students[2] = 4 by 1 move then it will equal to 3\noutput = 4\nnow you can see that students={1,5,3}\nwhose elemets are equal to seats array\n\nNow if we sort both the arrays in increasing order \nsuch that \n1         3        5\n|dif=1    | dif=1  |dif = 2      1+1+2=4(which is the output)\n2         4        7\nTHe absolute difference of elements will give the answer\n\n**IF YOU LIKE IT PLEASE UPVOTE**\n\n### Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int minMovesToSeat(int[] seats, int[] students) {\n        Arrays.sort(seats);\n        Arrays.sort(students);\n        int sum=0;\n        for(int i=0;i<seats.length;i++){\n            sum+=Math.abs(seats[i]-students[i]);\n        }\n        return sum;\n    }\n}\n```
['Java']