You are given the root of a full binary tree with the following properties:
Leaf nodes have a value of False and True respectively.
Non leaf nodes have a value of OR and boolean AND operations respectively.
The evaluation of a node is defined as:
If the node is a leaf, its evaluation is the boolean value represented by its value (False and True).
Otherwise, evaluate the left and right children and apply the boolean operation corresponding to the current node (OR, AND) to their evaluated results.
Return the boolean result of evaluating the root node.
Constraints:
The number of nodes in the tree is in the range
Node.val
Every node has either
Leaf nodes have a value of
Non leaf nodes have a value of
You are given the root of a full binary tree with the following properties:
Leaf nodes have a value of False and True respectively.
Non leaf nodes have a value of OR and boolean AND operations respectively.
The evaluation of a node is defined as:
If the node is a leaf, its evaluation is the boolean value represented by its value (False and True).
Otherwise, evaluate the left and right children and apply the boolean operation corresponding to the current node (OR, AND) to their evaluated results.
Return the boolean result of evaluating the root node.
Constraints:
The number of nodes in the tree is in the range
Node.val
Every node has either
Leaf nodes have a value of
Non leaf nodes have a value of