
June 30, 2012. The world's clocks get an extra second bolted onto the last minute of the day, so UTC reads 23:59:60. Plenty of Linux servers had never been told that a minute can hold 61 seconds, and they hang hard enough that some data centres watched their power draw spike. Qantas went back to checking passengers in by hand. Teach the clock about the second that should not exist.
Objective
Return whether a wall clock time is valid, including the leap second.
Steps
$ valid_time(12, 30, 45)
1
$ valid_time(23, 59, 60)
1
$ valid_time(12, 30, 60)
0
Expected files
Allowed functions
None. Write every helper yourself.
Loading solutions...