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

 

jebbert@volusia.k12.fl.us > sep9_2016_HL_removeDuplicates
prev  |  next  |  chance

Write a method that accepts an array of integers in non-decreasing order (meaning each successive value will be the same or greater than the previous value). Return a new array of integers with all of the duplicates removed. See the test data for examples. Note that the input parameter array will contain at least one number and that for all values in the array value(n)<=value(n+1).


sep9_2016_HL_removeDuplicates([5, 7, 8, 9, 11, 14, 17]) → [5, 7, 8, 9, 11, 14, 17]
sep9_2016_HL_removeDuplicates([7, 7, 7, 7, 8, 8, 9, 10, 11, 11, 11, 12]) → [7, 8, 9, 10, 11, 12]
sep9_2016_HL_removeDuplicates([4]) → [4]

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

public int[] sep9_2016_HL_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: 250

Copyright Nick Parlante 2017 - privacy