seats array in non-decreasing order.students array in non-decreasing order.totalMoves to 0 to keep track of the total number of moves.i.i, calculate the absolute difference between seats[i] and students[i].totalMoves.totalMoves as the result.