
December 31, 2008. Every Microsoft Zune 30 in the world locks up on the same day. The clock driver counted days into years, but 2008 was a leap year, and on day 366 the code reached a branch nobody had written: it just kept looping, forever. Owners were told to let the battery run flat and wait for January 1, when the device would quietly work again. Repair the loop so the last day of a leap year ends the count instead of spinning.
Repair this code
Repair the leap-year branch so day 366 resolves to its year instead of looping forever.
Steps
$ year_from_days(1)
1980
$ year_from_days(366)
1980
$ year_from_days(367)
1981
Expected files
Allowed functions
None. Write every helper yourself.
Loading solutions...