← Unit 4 · all exercises
Saved in this browser only

Count the big ones

Return how many numbers in the list are greater than the limit given.

int countAbove(java.util.ArrayList<Integer> list, int limit)

Solution.java
Loading editor…
Results

Examples

  • Solution.countAbove(new java.util.ArrayList<>(java.util.List.of(1, 5, 9)), 4) → 2
  • Solution.countAbove(new java.util.ArrayList<>(java.util.List.of(1, 2)), 10) → 0

There are also 3 hidden tests you can't see. Solve the problem, not the examples.