Solution to Populating Next Right Pointers in Each Node by LeetCode

9 Jul

Question: https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/ Question Name: Populating Next Right Pointers in Each Node

Solution to Pascal's Triangle II by LeetCode

7 Jul

Question: https://oj.leetcode.com/problems/pascals-triangle-ii/ Question Name: Pascal’s Triangle II

Solution to Pascal's Triangle by LeetCode

7 Jul

Question: https://oj.leetcode.com/problems/pascals-triangle/ Question Name: Pascal’s Triangle

Solution to Distinct Subsequences by LeetCode

7 Jul

Question: https://oj.leetcode.com/problems/distinct-subsequences/ Question Name: Distinct Subsequences This is a dynamic programming challenge. Firstly I solved it with recursion. But that solution did not satisfy the time requirement. These two posts give more details about the right solution: LeetCode: Distinct Subsequences(不同子序列的个数)(in … Read More »

Solution to Flatten Binary Tree to Linked List by LeetCode

6 Jul

Question: https://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/ Question Name: Flatten Binary Tree to Linked List The recursive method is easy to understand.

The iterative solution should be more efficient.

Solution to Path Sum II by LeetCode

6 Jul

Question: https://oj.leetcode.com/problems/path-sum-ii/ Question Name: Path Sum II

Solution to Path Sum by LeetCode

6 Jul

Question: https://oj.leetcode.com/problems/path-sum/ Question Name: Path Sum

Solution to Minimum Depth of Binary Tree by LeetCode

5 Jul

Question: https://oj.leetcode.com/problems/minimum-depth-of-binary-tree/ Question Name: Minimum Depth of Binary Tree

Solution to Balanced Binary Tree by LeetCode

5 Jul

Question: https://oj.leetcode.com/problems/balanced-binary-tree/ Question Name: Balanced Binary Tree