about | help | code help+videos | done | prefs |
Write a method that returns an array of integers with all occurances of 'numToDelete' "deleted" from the array. By deleted I mean that those numbers have been replaced by zero, but their positions are still in the array. If 'numToDelete' does not exist anywhere in the original array, return an empty array. drWhoDeleteNumbers([4, 6, 7, 2, 4, 8, 12], 4) → [0, 6, 7, 2, 0, 8, 12] drWhoDeleteNumbers([5, 7, 6, 5, 5, 7, 7], 20) → [] drWhoDeleteNumbers([1, 2, 3, 4, 5, 6, 7, 8], 7) → [1, 2, 3, 4, 5, 6, 0, 8] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 280
Copyright Nick Parlante 2017 - privacy