Topics 1 general

N Sum x4

leetcode 1 - Two Sum [E] - hash see hash table #nsum
leetcode 167 - Two Sum II - Input array is sorted [M] - binary search see binary search #twosum
leetcode 170 - Two Sum III - Data structure design [E] see design #twosum
leetcode 259 - 3Sum Smaller [M] - array, two pointer

Basic Calculator x5

see stack #arithmetic calculator
leetcode 150 - Evaluate Reverse Polish Notation [M] - stack
leetcode 224 - Basic Calculator [H] - stack
leetcode 227 - Basic Calculator II [M] - stack, record pre
leetcode 772 - Basic Calculator III [H]
leetcode 241 - Different Ways to Add Parentheses [M] - divide n conquer / dfs see dfs #parentheses divide and conquer #parentheses
leetcode 282 - Expression Add Operators [H]

Parentheses x3

leetcode 20 - Valid Parentheses [E] - hash + stack see stack #parentheses
leetcode 22 - Generate Parentheses [M] - backtracking see backtracking #parentheses
leetcode 241 - Different Ways to Add Parentheses [M] - divide n conquer / dfs see dfs #parentheses divide and conquer #parentheses

Palindrome x10

leetcode 9 - Palindrome Number [E]
leetcode 125 - Valid Palindrome [E] - string see string #palindrome
leetcode 131 - Palindrome Partitioning [M] - backtracking see backtracking #palindrome
leetcode 132 - Palindrome Partitioning II [H] - dp see dp #palindrome
leetcode 214 - Shortest Palindrome [H] - string see string #palindrome
leetcode 234 - Palindrome Linked List [E] - linked list see linked list #palindrome
leetcode 266 - Palindrome Permutation [E] - hash see hash #palindrome
leetcode 267 - Palindrome Permutation II [M] - backtracking see backtracking #palindrome
leetcode 336 - Palindrome Pairs [H] - hash, trie see trie #palindrome
leetcode 409 - Longest Palindrome [E] - hash see hash #palindrome

Combination x7

leetcode 17 - Letter Combinations of a Phone Number [M] - backtracking
leetcode 77 - Combinations [M] - backtracking
leetcode 39 - Combination Sum [M] - backtracking
leetcode 40 - Combination Sum II [M] - backtracking
leetcode 216 - Combination Sum III [M] - backtracking
leetcode 254 - Factor Combinations [M] - backtracking see backtracking #combinations
leetcode 377 - Combination Sum IV [M] - dp see dp

Permutation x6

leetcode 31 - Next Permutation [M] - array see array #permutation
leetcode 46 - Permutations [M] - backtracking
leetcode 47 - Permutations II [M] - backtracking see backtracking #permutation
leetcode 60 - Permutation Sequence [M] - math see math #permutation
leetcode 266 - Palindrome Permutation [E] - hash see string #palindrome
leetcode 267 - Palindrome Permutation II [M] - backtracking see backtracking #palindrome

Linked List

Binary Tree x19

Operations see tree #implementation
leetcode 104 - Maximum Depth of Binary Tree [E]
leetcode 111 - Minimum Depth of Binary Tree [E]
leetcode 222 - Count Complete Tree Nodes [M]
leetcode 110 - Balanced Binary Tree [E]
leetcode 94 - Binary Tree Inorder Traversal [M]
leetcode 144 - Binary Tree Preorder Traversal [M]
leetcode 145 - Binary Tree Postorder Traversal [H]
leetcode 102 - Binary Tree Level Order Traversal [M]
leetcode 103 - Binary Tree Zigzag Level Order Traversal [M]
leetcode 107 - Binary Tree Level Order Traversal II (bottom-up) [E]
leetcode 199 - Binary Tree Right Side View [M]
leetcode 105 - Construct Binary Tree from Preorder and Inorder Traversal [M]
leetcode 106 - Construct Binary Tree from Inorder and Postorder Traversal [M]

Applications see tree #problems
leetcode 100 - Same Tree [E]
leetcode 101 - Symmetric Tree [E]
leetcode 112 - Path Sum [E]
leetcode 113 - Path Sum II [M]
leetcode 124 - Binary Tree Maximum Path Sum [H]
leetcode 129 - Sum Root to Leaf Numbers [M]
leetcode 236 - Lowest Common Ancestor of a Binary Tree [M]
leetcode 250 - Count Univalue Subtrees [E]

Binary Search Tree

leetcode 235 - Lowest Common Ancestor of a Binary Search Tree [E]
leetcode 270 - Closest Binary Search Tree Value [E]
leetcode 272 - Closest Binary Search Tree Value II [M]

Trie

Graph

Sorting

leetcode 164 - Maximum Gap [H]
leetcode 215 - Kth Largest in an Array [M] - min heap see heap #problems
leetcode 218 - The Skyline Problem [H] - priority queue, min heap see priority queue #problems
leetcode 252 - Meeting Rooms [E] see sorting #problems
leetcode 253 - Meeting Rooms II - min heap[M] see heap #problems
leetcode 274 - H-index [M] - bucket sort see sorting #problems
leetcode 275 - H-index II (given sorted) [M] - binary search see binary search #h-index leetcode 280 - Wiggle Sort [M]

Stack

Queue

Bit Manipulation

leetcode 136 - Single Number - xor[E]
leedcode 137 - Single Number II - xor[M]
leedcode 260 - Single Number III - xor[M] see bit Manipulation # cancel out

Greedy

see greedy
leetcode 134 - Gas Station [M]
leetcode 135 - Candy [H]
leetcode 277 - Find the Celebrity [M] (array? not sure)

Arithmetic Calculator

leetcode 150 - Evaluate Reverse Polish Notation [M]
leetcode 224 - Basic Calculator [H] leetcode 227 - Basic Calculator II [M] see stack #arithmetic leetcode 282 - Expression Add Operators [H] see [dfs]

Topics 2 multi-ans

Majority Elements x2

see topics 2
leetcode 169 - Majority Element [E]
leetcode 229 - Majority Element II [M]

Kth Largest/Smallest Element x2

seetopics 2
leetcode 215 - Kth Largest in an Array [M]
leetcode 230 - Kth Smallest in a BST [M] see bst #Kth smallest

Topics 3 series

Find Dups x4

leetcode 217 - Contains Duplicate [E] - hash
leetcode 219 - Contains Duplicate II [E] - hash
leetcode 220 - Contains Duplicate III [M] - hash see hash #find dups
leetcode 287 - Find the Duplicate Number [M] - two pointers circle see array #find ele

Best Time Buy n Sell x4

see topics 3
leetcode 121 - Best Time to Buy and Sell Stock (Once) [E] - record min and max
leetcode 122 - Best Time to Buy and Sell Stock II (Multiple) [E]
leetcode 123 - Best Time to Buy and Sell Stock III (Twice) [H]
leetcode 188 - Best Time to Buy and Sell Stock IV (k times) [H] - dp

House Robber x2

see topics 3
leetcode 198 - House Robber [E] - light dp
leetcode 213 - House Robber II [M]

Paint House x2

leetcode 256 - Paint House [E] - dp
leetcode 265 - Paint House [H] - dp,record 2 mins see dp #paint colors

Paint Fence

leetcode 276 - Paint House [E] - dp see dp #paint colors

Word Break x2

see dp #word break
leetcode 139 - Word Break [M] - dp leetcode 140 - Word Break II [H] - dp + dfs

Word Pattern x2

leetcode 290 - Word Pattern [E] - hash
leetcode 291 - Word Pattern (no space split) [H] - hash+backtracking

Flip Game x2

leetcode 293 - Flip Game [E] - string
leetcode 294 - Flip Game II [M] - backtracking

Word Ladder x2

see topics 3
leetcode 127 - Word Ladder [M] (return shortest length) - bfs
leetcode 126 - Word Ladder II [H] (return all shortest sequences) - dfs, bidirectional bfs

Shortest Word Distance x3

see topics 3
leetcode 243 - Shortest Word Distance [E]
leetcode 244 - Shortest Word Distance II [M] - hash
leetcode 245 - Shortest Word Distance III (repeated) [M]

Strobogrammatic Number x3

leetcode 246 - Strobogrammatic Number [E] - hash see hash #strobogrammatic
leetcode 247 - Strobogrammatic Number II [] - math
leetcode 248 - Strobogrammatic Number III [] - math see math #strobogrammatic

Ugly Number x4

leetcode 263 - Ugly Number [E]
leetcode 264 - Ugly Number II [M]
Ugly Number III
Super Ugly Number