Problem 1361 · Medium

Validate Binary Tree Nodes

Check that the child arrays form exactly one binary tree: one root, no node with two parents, and every node reachable from it.

Open the interactive visualisation