# LeetCode 120. Triangle

Triangle. Surprisingly, this problem can be solved by the same method as in Pascal’s Triangle.

# LeetCode 119. Pascal’s Triangle II

Pascal’s Triangle II. Not sure if there is a better one, I solve this problem using exactly the same solution as I have in Pascal’s Triangle.

# LeetCode 118. Pascal’s Triangle

Pascal’s Triangle. Just general Pascal’s triangle row by row, based the Math definition.

# LeetCode 117. Populating Next Right Pointers in Each Node II

Populating Next Right Pointers in Each Node II. Same as Populating Next Right Pointers in Each Node. But you need to be more flexible because all the next pointers of a…

# LeetCode 116. Populating Next Right Pointers in Each Node

Populating Next Right Pointers in Each Node. Low level list node operation. You need to link the left child to the right child of a root first, then link the…

# LeetCode 115. Distinct Subsequences

Distinct Subsequences. Classic DP problem. Define dp[i,j] is the number of distinct subsequences between s[0..j-1] and t[0..i-1]. (it is a bit tedious on the subscript) Then if s[j] == t[i]…

# LeetCode 111. Minimum Depth of Binary Tree

Minimum Depth of Binary Tree. Just recursively calculate the min depth of left and right subtree, pick the smaller one and add one to the depth.

# LeetCode 109. Convert Sorted List to Binary Search Tree

Convert Sorted List to Binary Search Tree. Same solution as Convert Sorted Array to Binary Search Tree. But you need to use a trick to get the middle point in the…

# LeetCode 108. Convert Sorted Array to Binary Search Tree

Convert Sorted Array to Binary Search Tree. Just take a middle node as the root and construct left and right tree recursively.

# LeetCode 107. Binary Tree Level Order Traversal II

Binary Tree Level Order Traversal II. Same solution as Binary Tree Level Order Traversal. I use a stack to reverse the level order.