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.
Asked in the Coding round stage. Implement construct_tree(s), returning the tree as nested dictionaries in the form {"children": [...]}. Return None for an empty string.
def construct_tree(s):