Search
⌘K

Leetcode 1361. Validate Binary Tree Nodes

Given n nodes and arrays leftChild/rightChild, determine whether they form exactly one valid binary tree — equivalently check there is exactly one root (one node with in-degree 0), every other node has exactly one parent, and the structure is connected with no cycles.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.