about | help | code help+videos | done | prefs |
Given an integer array and a target value, use the linear search algorithm to search for the value, but instead of returning the value's index or -1, return the number of elements you had to access! linearSearch_access([7, 9, 5], 9) → 2 linearSearch_access([4, 8, 3, 1], 3) → 3 linearSearch_access([1, 6, 4, 3, 8, 2], 5) → 6 ...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