about | help | code help+videos | done | prefs |
Given an ArrayList of Integers and an int target, find and return the index whose value is closest to the target. In the case of a tie, return the first index of the tied values. Precondition: lst will have at least one element. apcsaListFindClosest([1, 3, 4, 5, 6], 8) → 4 apcsaListFindClosest([1], 3) → 0 apcsaListFindClosest([0, 1, 2, 3, 4], 4) → 4 ...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