GoConqr has a new look! Let us know what you think.

Flashcards

Remove Duplicates from Sorted Array

Suhas S English 1 card

Cards in this deck (1)

  1. 1Remove Duplicates from Sorted Arrayclass Solution {
    public int removeDuplicates(int[] nums) {
    if(nums == null) return 0;
    int j = 1;
    for(int i = 1; i< nums.length ;++i){
    if(nums[i] != nums[i-1]) nums[j++] = nums[i];
    }
    return j;
    }
    }

Information

Description
Flashcards on Remove Duplicates from Sorted Array, created by Suhas S on 15/02/2018.
Created by
Suhas S
Views
7
Tags
array
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?