about | help | code help+videos | done | prefs |
Write a method named countInRange that accepts an array of integers, a minimum value, and a maximum value as parameters and returns the count of how many elements from the array fall between the minimum and maximum (inclusive). For example, in the list containing {14, 1, 22, 17, 36, 7, -43, 5}, there are 4 elements whose values fall between 4 and 17. The input would be the list, the minimum value 4, and the maximum value 17. The output would be 4 since there are 4 elements in that range. countInRange([14, 1, 22, 17, 36, 7, -43, 5], 4, 17) → 4 countInRange([1, 2, 3, 4, 5], 1, 5) → 5 countInRange([1, 2, 3, 4, 5], 6, 100) → 0 ...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: 200
Copyright Nick Parlante 2017 - privacy