Construct an N-ary tree from a balanced-parentheses string.
Unlock detailed company stats for this questionUpgrade
Given a balanced-parentheses string, construct and return the root of an N-ary tree. Each matching () represents a node, and parentheses directly nested inside it represent its children.
Example: (()()(()))
Community answers
No answers contributed by the community yet.
Related questions
Construct a binary tree from an ancestor matrix.Check whether a string of parentheses is balanced.Balanced Parentheses.Related courses

Course

Course
Course
