
February 25, 1991, Dhahran. A Patriot battery tracks an incoming Scud but never fires, and the missile hits a barracks, killing 28 American soldiers. The system counted time in tenths of a second, and one tenth cannot be stored exactly in its arithmetic, so a sliver of error piled up with every tick. After a hundred hours running without a reboot the clock had drifted about a third of a second, enough to swing the radar's search window hundreds of meters off. The grim workaround was to reboot often. Compute the drift and tell whether the intercept still lands.
Objective
From the uptime in hours, compute the accumulated clock drift and return whether the tracking gate has slipped too far.
Steps
$ gate_slips(8)
0
$ gate_slips(100)
1
$ gate_slips(50)
0
Expected files
Allowed functions
None. Write every helper yourself.
Loading solutions...