id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

removeDuplicates


Given an array of integers, return a new array containing the same integers. However, if a value appears more than once in an array, the new array should contain only the first occurrence of that value.


removeDuplicates([3, 4, 1, 3, 5]) → [3, 4, 1, 5]
removeDuplicates([1, 1, 2, 1, 2, 2, 1, 2]) → [1, 2]
removeDuplicates([5, 6]) → [5, 6]

...Save, Compile, Run (ctrl-enter)

int[] removeDuplicates(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 300

Copyright Nick Parlante 2017 - privacy