For this challenge I spent most of the time parsing input (those pesky line breaks).
After I meticulously recreated table with opcodes, solution itself was straight forward.
Part 1 - test each command, add to counter if success, add to bigger counter if more than three successes.
Part 2 - test each command to get a table with all possible opcodes, then find opcode(s) that have only one option, remove that opcode from the table. Repeat until the table is empty.
For this challenge I spent most of the time parsing input (those pesky line breaks).
After I meticulously recreated table with opcodes, solution itself was straight forward.
Part 1 - test each command, add to counter if success, add to bigger counter if more than three successes.
Part 2 - test each command to get a table with all possible opcodes, then find opcode(s) that have only one option, remove that opcode from the table. Repeat until the table is empty.
readFile.php