All challenges

Tuesday, 8 September 2026

Past

Three rungs, one idea. Solving rung 1 counts. Climb as far as you can.

Hours And Minutes

functions + whole-number maths

Rung 1Daily goal5 points

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

InputOutput
2, 30150
0, 00
1, 060
0, 4545

There are extra hidden tests, so make it work in general, not just for these.

Rung 2Bonus7 points

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

InputOutput
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.

Rung 3Bonus10 points

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

InputOutput
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.