@@ -0,0 +1,575 @@
+/**%0A * Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.%0A%0ADo not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.%0A */%0Aclass Solution %7B%0A    public int removeDuplicates(int%5B%5D nums) %7B%0A        if(nums.length %3C= 1) return nums.length;%0A        int curr = 1;%0A        for(int i = 1; i %3C nums.length; i++)%7B%0A            if(nums%5Bi%5D != nums%5Bi-1%5D)%7B%0A                nums%5Bcurr++%5D = nums%5Bi%5D;%0A            %7D%0A        %7D%0A        return curr;%0A    %7D%0A%7D

remove duplicates from sorted arr