Skip to content

Instantly share code, notes, and snippets.

@kanglicheng
Last active June 12, 2020 21:31
Show Gist options
  • Save kanglicheng/13f76d9670bedda75a975c92153f9374 to your computer and use it in GitHub Desktop.
Save kanglicheng/13f76d9670bedda75a975c92153f9374 to your computer and use it in GitHub Desktop.
important problems to solve
Classic:
2. Add two numbers
3. Longest substring without repeating characters
5. Longest palindromic substring
73. Set Matrix Zeroes
138. Copy List with Random Pointer
146. LRU Cache
289. Game of Life
Backtracking:
22. Generate Parentheses
39. Combination Sum
77. Combinations
78. Subsets
BFS or DFS:
127 Word Ladder
139 Word Break
199. Binary Tree Right Side View
200. number of islands
DFS+backtracking:
79. Word Search
DFS+pruning
Graph/Topological Sort:
207. Course Schedule
210. Course Schedule II
269. Alien Dictionary
997. Find the Town Judge
Greedy:
403. Frog Jump
Heap
252. Meeting Rooms
253. Meeting Rooms II (extremely popular)
Stack:
224. Basic Calculator
227. Basic Calculator II
394. Decode String (popular)
@jw1907
Copy link

jw1907 commented Feb 6, 2020

DFS:
Lintcode 246 Path sum by path(rather than node)
Your are given a binary tree in which each node contains a value. Design an algorithm to get all paths which sum to a given value. The path does not need to start or end at the root or a leaf, but it must go in a straight line down. Return all paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment