Back to course home
0% completed
Vote For New Content
Another way of doing it
Mohammed Dh Abbas
Jul 18, 2024
class Solution: def sort(self, nums): def swap(i, j): temp = nums[i] nums[i] = nums[j] nums[j] = temp for i in range(len(nums)): # while the nums[i] is not in position keep swapping it while nums[i] != i + 1: swap(i, nums[i] - 1) return nums
0
0
Comments
Comments
On this page