Your question is Preloaded Problem Engine Class. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Coalition Control organizes cyber-risk assessment challenges into named problem sets. Implement an engine that is preloaded with those sets, preserves problem order, removes duplicates, supports combined set queries, and tracks completed problems.
Create a ProblemSetEngine and a wrapper function run_engine(problem_sets, operations).
problem_sets is a dictionary mapping a set name to a list of problem ID strings. Duplicate IDs within a set are possible.{"op": "list", "set": name}: return unique problem IDs from that set, in first-seen order.{"op": "union", "sets": [name1, name2, ...]}: return unique IDs from the named sets, scanning sets in the given order.{"op": "complete", "problem": id}: mark the problem complete and return true only if it was known and not already complete. Otherwise return false.{"op": "next", "set": name}: return the first incomplete problem in that set, or null if none remain.def run_engine(problem_sets, operations):