# LeetCode
# 22. Generate Parentheses
We first write the first three situation, and find that we could concat a new parenthesis into the old results by recursion.
1 | |
# 46. Permutations
A simple dfs recursion. Be cautious to the slice reference problem of go.
1 | |
optimization
1 | |
# 40. Combination Sum II
Recursion to try out every solution. Be aware of skip the used elements using can[i] == can[i - 1] && used[i - 1] == false.
1 | |
# 39. Combination Sum
Recursion to try out every solution.
1 | |
# 95. Unique Binary Search Trees II
Build the right and left trees recursively. Be aware of generating nil nodes.
1 | |
# 241. Different Ways to Add Parentheses
Quite similar to 95. Dive and conquer.
1 | |
Word Ladder