Exercise 1 solution (Python) def to_min(t): h, m = t.split(":") return int(h) * 60 + int(m) def to_clock(mins): return f"{mins // 60:02d}:{mins % 60:02d}" def turn_back_time(dark, remaining_min, margin=30): return to_clock(to_min(dark) - remaining_min - margin) print(turn_back_time("16:10", 140)) print(turn_back_time("16:10", 140, 60)) Output: 13:20 12:50 Dark at 16:10 is 970 minutes after midnight. Subtract the 140 minutes needed to get back to the road and the 30 minute margin and you get 800 minutes, which is 13:20. A 60 minute margin moves the turn-back time half an hour earlier, to 12:50. The turn-back time is worked out before you start, from the time it gets dark, not from how you feel when you are tired.