Python Easiest Solution With Explanation | Sorting | Beg to adv
python\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n        total_moves = 0 # taking a int variable to store t
```python\nclass Solution:\n    def minMovesToSeat(self, seats: List[int], students: List[int]) -> int:\n        total_moves = 0 # taking a int variable to store the value\n        sorted_seats = sorted(seats) # sorting the seat list\n        sorted_students = sorted(students) #sorting the student list\n        \n        diff_1 = [] # taking empty list for storing difference of both the list\n        for i in range(len(seats)):\n            diff = abs(sorted_seats[i] - sorted_students[i]) # calculating diff of both the list elements, to calculate numbers of move. \n            diff_1.append(diff) # appending the Difference to the empty list declared by us. \n        \n        for i in diff_1: # loop for traversing the diff of elems from both the lists.\n            total_moves += i # adding them to calculate the moves. \n        \n        return total_moves\n```\n\n```python\n\t\t"""\n        Short form of above solution:-\n        """\n        #first sort both the lists\n        seats.sort() \n        students.sort()\n        \n        res = 0 # variable to store the result\n        \n        for i in range(len(seats)): \n            res += abs(students[i] - seats[i]) # calculating diff of both the list and adding it to the variable , rather then adding it to the list, and then to traverse that list for the total moves.\n            \n        return res\n```\n\n***Found helpful, Do upvote !!***
['Sorting', 'Python', 'Python3']