Simple Network: Endpoint or Cycle-Closing Node

Problem

You are given a directed network in which each node has at most one outgoing edge. Implement:

compute(start_node_id, from_ids, to_ids)

The two equal-length arrays describe t...

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: