Solution to Binary Tree Maximum Path Sum by LeetCode

10 Jul

Question: https://oj.leetcode.com/problems/binary-tree-maximum-path-sum/ Question Name: Binary Tree Maximum Path Sum

Solution to Best Time to Buy and Sell Stock II by LeetCode

10 Jul

Question: https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ Question Name: Best Time to Buy and Sell Stock II

Solution to Best Time to Buy and Sell Stock by LeetCode

9 Jul

Question: https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/ Question Name: Best Time to Buy and Sell Stock

Solution to Triangle by LeetCode

9 Jul

Question: https://oj.leetcode.com/problems/triangle/ Question Name: Triangle

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.