about | help | code help+videos | done | prefs |
Given an integer array "a", return an array with the same values as "a" but without any values of 5. To remove an element from an array, you cannot use .remove() (that is for ArrayLists). First, create a new array with the correct final length. Then, fill it up with all of the non-5 values from "a". Finally, return that new array. array_fivesDisappear([3, 4, 5]) → [3, 4] array_fivesDisappear([5, 4, 3]) → [4, 3] array_fivesDisappear([5, 5, 1, 5, 5]) → [1] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy