Identify Bad Nodes in Network

Given N nodes. You can call a function test(S) to test a set of nodes S:

  1. If S contains at least one bad node, then test(S) = False;
  2. If S contains all good nodes, then test(S) = True.

Additiona...

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: