
In 2015 the FAA told every airline flying a Boeing 787 to power the aircraft all the way off before it reached 248 days without a reboot. Buried in the electrics was a counter ticking every hundredth of a second, held in a signed 32-bit integer. Somewhere around day 248 that counter overflows its limit, the generator control units all drop to failsafe, and the plane can lose its AC power in the air. The fix was, quite literally, turn it off and on again. Your job: flag the tick count before it overflows.
Objective
Return 1 while the centisecond tick count still fits in a signed 32-bit integer, 0 once it would overflow.
Steps
$ counter_ok(0)
1
$ counter_ok(2147483647)
1
$ counter_ok(2147483648)
0
Expected files
Allowed functions
None. Write every helper yourself.
Loading solutions...