about | help | code help+videos | done | prefs |
apcsaListRemoveCloseUnder
Given an ArrayList of Integers and an int target, find the first element with the highest value lower than target. Remove that element, and return the modified ArrayList. It's possible that no elements have values less than the target, in which case no elements would be removed. Example: suppose the ArrayList contains all the odd numbers less than 10 (e.g. 1, 3, 5, 7, 9 in order) and the target is 8, then the largest of the elements less than 8 would be 7. The remaining elements are [1, 3, 5, 9] which is what would be returned.apcsaListRemoveCloseUnder([3, 5, 7, 9], 8) → [3, 5, 9] apcsaListRemoveCloseUnder([3, 5, 7, 9], 9) → [3, 5, 9] apcsaListRemoveCloseUnder([3, 5, 7, 9], 10) → [3, 5, 7] ...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: 220
Copyright Nick Parlante 2017 - privacy