share my c code


  • 0
    X
      int removeDuplicates(int* nums, int numsSize) {
        if(numsSize == 0) return 0;
        int start = 0;
        for(int i = 1;i<numsSize;i++){
            if(nums[i] != nums[start])
                nums[++start] = nums[i];
            
        }
       return ++start;
    }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.