Remove the duplicates from the array without extra space.

Remove the duplicates from the array without extra space.

Here the logic is simple. If we are making the value in an array for the present index as negative. So that if we counter the same value again then we know encountered the negative value and we will know that this is a duplicate number. Study the program for more understanding.

Leave a Reply

Your email address will not be published. Required fields are marked *