Graph Variant: Endings Reachable Only If Both Options Are Explored (Follow-up)

Follow-up to the previous problem: model everything as a directed graph (nodes are story segments; edges are option transitions). Add a constraint:

For a node with choice = [start, op1, op2], an en...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: