diff --git a/assets/606 ex1.png b/assets/606 ex1.png new file mode 100644 index 000000000..835531992 Binary files /dev/null and b/assets/606 ex1.png differ diff --git a/assets/606 ex2.png b/assets/606 ex2.png new file mode 100644 index 000000000..07410af1b Binary files /dev/null and b/assets/606 ex2.png differ diff --git a/dsa-solutions/lc-solutions/0600-0699/0606-Construct-String-from-Binary-Tree.md b/dsa-solutions/lc-solutions/0600-0699/0606-Construct-String-from-Binary-Tree.md index 3991a9f31..7b973c7c0 100644 --- a/dsa-solutions/lc-solutions/0600-0699/0606-Construct-String-from-Binary-Tree.md +++ b/dsa-solutions/lc-solutions/0600-0699/0606-Construct-String-from-Binary-Tree.md @@ -14,15 +14,18 @@ description: "Given the root of a binary tree, construct a string consisting of Given the root of a binary tree, construct a string consisting of parenthesis and integers from a binary tree with the preorder traversal way. ### Examples - **Example 1:** +![Screenshot of the application](.././../../assets/606%20ex1.png) + **Input:** `root = [1,2,3,4]` **Output:** `"1(2(4))(3)"` **Explanation:** Originally, it needs to be `"1(2(4)())(3()())"`, but you need to omit all the unnecessary empty parenthesis pairs. And it will be `"1(2(4))(3)"` **Example 2:** +![Screenshot of the application](.././../../assets/606%20ex2.png) + **Input:** `root = [1,2,3,null,4]` **Output:** `"1(2()(4))(3)"` **Explanation:** Originally, it needs to be `"1(2()(4)())(3()())"`, but you need to omit all the unnecessary empty parenthesis pairs. And it will be `"1(2()(4))(3)"` @@ -127,4 +130,4 @@ class Solution: >Reason: The space complexity is determined by the recursion stack, which in the worst case (unbalanced tree) is O(n), but on average (balanced tree) is O(log n). ### References -**LeetCode Problem:** Construct String from Binary Tree \ No newline at end of file +**LeetCode Problem:** Construct String from Binary Tree diff --git a/dsa-solutions/lc-solutions/0600-0699/screenshot.png b/dsa-solutions/lc-solutions/0600-0699/screenshot.png new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/dsa-solutions/lc-solutions/0600-0699/screenshot.png @@ -0,0 +1 @@ +