← Unit 2 · all exercises
Saved in this browser only

Outside the range

Return true when the value falls outside low to high, not counting the ends themselves as outside. Writing this with || is easier than negating an &&, though both work.

boolean outside(int value, int low, int high)

Solution.java
Loading editor…
Results

Examples

  • outside(15, 1, 10) → true
  • outside(5, 1, 10) → false

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