Tuesday, 8 September 2026
PastThree rungs, one idea. Solving rung 1 counts. Climb as far as you can.
Hours And Minutes
functions + whole-number maths
Turn it into minutes
Write a function called to_minutes
You get a number of hours and a number of minutes, both 0 or bigger. Return how many minutes that is altogether. 2 hours and 30 minutes is 150 minutes.
Examples
| Input | Output |
|---|---|
| 2, 30 | 150 |
| 0, 0 | 0 |
| 1, 0 | 60 |
| 0, 45 | 45 |
There are extra hidden tests, so make it work in general, not just for these.
Split it back up
Write a function called split_minutes
Now go the other way. You get a total number of minutes and return a list of two numbers, [hours, minutes], where the minutes part is always less than 60. 150 gives [2, 30].
Examples
| Input | Output |
|---|---|
| 150 | [2, 30] |
| 0 | [0, 0] |
| 59 | [0, 59] |
| 60 | [1, 0] |
There are extra hidden tests, so make it work in general, not just for these.
What time will it be
Write a function called time_after
You get a clock time as hours and minutes, plus some extra minutes to wait. Return the new time as a list [hours, minutes] on a 24-hour clock, so after 23 the hours go back to 0. Waiting 45 minutes from 23, 30 gives [0, 15].
Examples
| Input | Output |
|---|---|
| 23, 30, 45 | [0, 15] |
| 1, 0, 30 | [1, 30] |
| 0, 0, 0 | [0, 0] |
| 12, 45, 20 | [13, 5] |
There are extra hidden tests, so make it work in general, not just for these.
Finish Rung 1 and today counts. Rungs 2 and 3 are there if you want to push further.