728x90
606. Construct String from Binary Tree
-
[LeetCode] 606. Construct String from Binary Tree c++Coding Test/LeetCode 2022. 12. 24. 14:58
문제 Given the root of a binary tree, construct a string consisting of parenthesis and integers from a binary tree with the preorder traversal way, and return it. Omit all the empty parenthesis pairs that do not affect the one-to-one mapping relationship between the string and the original binary tree. Input: root = [1,2,3,null,4] Output: "1(2()(4))(3)" Explanation: Almost the same as the first ex..