You are given a descriptions, where descriptions[i] = [parent_i, child_i, isLeft_i] indicates that parent_i is the parent of child_i in a binary tree.
The value of isLeft_i determines the position of child_i:
If isLeft_i child_i is the left child of parent_i.
If isLeft_i child_i is the right child of parent_i.
Construct the binary tree described by descriptions and return its root node.
Constraints:
descriptions.length
descriptions[i].length
parent_i, child_i
isLeft_i
The binary tree described by descriptions is valid.
You are given a descriptions, where descriptions[i] = [parent_i, child_i, isLeft_i] indicates that parent_i is the parent of child_i in a binary tree.
The value of isLeft_i determines the position of child_i:
If isLeft_i child_i is the left child of parent_i.
If isLeft_i child_i is the right child of parent_i.
Construct the binary tree described by descriptions and return its root node.
Constraints:
descriptions.length
descriptions[i].length
parent_i, child_i
isLeft_i
The binary tree described by descriptions is valid.