solution to Remove Duplicates from Sorted Array