Concept Flow - Remove Duplicates from Sorted Array Two Pointer
Start with two pointers
Pointer i at index 0
Pointer j scans from index 1 to end
Compare arr[j
j
End when j reaches array end
Return length i+1 as new size
Two pointers scan the sorted array; one tracks unique elements, the other scans ahead to find new unique values to copy forward.
