
February 2016. Word spreads that you can brick any 64-bit iPhone by setting its date to January 1, 1970. People try it as a prank and their phones never boot again, not even after a charge or a reset. The clock counts seconds from that exact epoch, and once a timezone offset pushed the value below zero, a service buried in iOS tripped over the negative time and hung forever on the boot screen. Catch the underflow before the counter slides back past 1970.
Objective
Return whether the device survives: its local time must not fall before the 1970 epoch.
Steps
$ survives(0, 0)
1
$ survives(0, -5)
0
$ survives(1, -5)
1
Expected files
Allowed functions
None. Write every helper yourself.
Loading solutions...