I have found this question in a interview
I have array
a = [0,0,1,1,1,2,2,3,4]
I have a sorted array and I want to remove the duplicates from the given array without using any other array, i.e. space complexity should be O(1). Output should be length of the array without duplicates.
Output,
a = [0,1,2,3,4]
length = 5