i = 1
for j in range(len(nums)):
if nums[i-1] != nums[j]:
nums[i], nums[j] = nums[j], nums[i]
i += 1
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.