Given a string s that represents a binary tree, construct and return the root of the binary tree.
The input string consists of an integer representing the root value, followed by zero, one, or two pairs of parentheses. Each pair of parentheses contains a child subtree structured in the same way. If a node has only one child, that child is always the left child.
Constraints:
s.length
s consists of digits, '(', ')', and '-' only.
All numbers in the tree have value at most
Given a string s that represents a binary tree, construct and return the root of the binary tree.
The input string consists of an integer representing the root value, followed by zero, one, or two pairs of parentheses. Each pair of parentheses contains a child subtree structured in the same way. If a node has only one child, that child is always the left child.
Constraints:
s.length
s consists of digits, '(', ')', and '-' only.
All numbers in the tree have value at most