Playing Hacks and Stuffs!
I was writing the solution to this but my firefox crashed and I didn’t save the commit yet
To rewrite that is stressfull so I’ll just drop the solve script
But basically this involves Removing Duplicate from a Sorted Array using In-Place Algorithm
Here’s my solve script: link
class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
replace = 1
for i in range(1, len(nums)):
if nums[i] != nums[i-1]:
nums[replace] = nums[i]
replace +=1
return replace