Split Drainage Tree

Split Drainage Tree

A drainage tree has n nodes numbered from 0 to n - 1, with node 0 as the root.

You are given:

  • an array parent, where parent[0] = -1 and parent[i] is the paren...

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: