Closed VarunVijay625 closed 1 day ago
The for loop adds to unique elements if i==0 which will always be true on first iteration, and adds arr[i-1] instead of arr[i] to removed elements. This will result in extra items in unique elements and removed elements.
Done :D
The for loop adds to unique elements if i==0 which will always be true on first iteration, and adds arr[i-1] instead of arr[i] to removed elements. This will result in extra items in unique elements and removed elements.