var minMovesToSeat = function(seats, students) {
const sortedSeats = [...seats].sort((a, b) => a - b);
const sortedStudents = [...students].sort((a, b) => a - b);
let result = 0;
sortedStudents.forEach((student, index) => {
result += Math.abs(student - sortedSeats[index]);
});
return result;
};