← Unit 1 · all exercises
Saved in this browser only

Minutes left over

Given a number of minutes, return how many are left after taking out as many whole hours as possible. 135 minutes is 2 hours and 15 minutes, so the answer is 15.

int leftOver(int minutes)

Solution.java
Loading editor…
Results

Examples

  • leftOver(135) → 15
  • leftOver(60) → 0

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