Problem Statement
Time Addition (24-hour format, Next Day)
You are given a time in 24-hour format (HH MM) and a duration in minutes (k). Your task is to compute the resulting time after adding the duration to the initial time.
If the resulting time is past midnight (i.e., it falls on the next day), append Next day to the output.
Examples
- Adding 25 minutes to
23:50results in00:15 Next day - Adding 30 minutes to
10:05results in10:35
Notes
- Use proper formatting with leading zeros for hours and minutes (e.g.,
05:07) - You may find the modulo operator (
%) helpful for handling time wraparound