A bootloader stores its program as an array of text instructions, and you need to find where the execution first starts repeating.
You are given instructions, where each entry has the form "<operation> <value>". The operation is one of "plus", "next", or "jump".
"plus x"addsxto a global accumulator, then moves to the next instruction.next xleaves the accumulator unchanged and moves to the next instruction. The valuexis preserved in the instruction format but is ignored and not used in this question."jump x"leaves the accumulator unchanged, then moves to the instruction at the current index plusx.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected