A spacecraft's flight computer appends one line of text to its boot-sequence log for every diagnostic step it completes during startup. Ground control wants a quick way to inspect exactly the tenth entry recorded in any given log, since that entry has historically been the most reliable indicator of a successful boot. Given the full contents of a log, report its tenth line (counting from 1). If the log was cut short and never reached a tenth entry, report that no such entry exists.
Example 1
Input
12 BOOT-INIT SENSOR-CAL GYRO-LOCK THRUST-ARM FUEL-CHECK NAV-SYNC COMMS-UP PWR-STABLE ORBIT-CALC DEPLOY-ARM PANEL-EXT SIGNAL-OK
Expected
DEPLOY-ARM
Explanation
There are 12 entries. Counting from 1: 1 BOOT-INIT, 2 SENSOR-CAL, 3 GYRO-LOCK, 4 THRUST-ARM, 5 FUEL-CHECK, 6 NAV-SYNC, 7 COMMS-UP, 8 PWR-STABLE, 9 ORBIT-CALC, 10 DEPLOY-ARM. Since n = 12 >= 10, the answer is the 10th entry, DEPLOY-ARM.
Example 2
Input
4 PING PONG ACK SYNC
Expected
NONE
Explanation
Only 4 entries were recorded, which is fewer than 10, so no tenth entry exists and the output is the literal text NONE.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →