1. Strings / Arrays & Hashing
- 1. Two Sum
- 6. Zigzag Conversion
- 14. Longest Common Prefix
- 28. Find the Index of the First Occurrence in a String
- 31. Next Permutation
- 36. Valid Sudoku
- 38. Count and Say
- 41. First Missing Positive
- 48. Rotate Image
- 49. Group Anagrams
- 54. Spiral Matrix
- 58. Length of Last Word
- 59. Spiral Matrix II
- 65. Valid Number
- 66. Plus One
- 73. Set Matrix Zeroes
- 118. Pascal’s Triangle
- 119. Pascal’s Triangle II
- 128. Longest Consecutive Sequence
- 151. Reverse Words in a String
- 157. Read N Characters Given Read4 🔒
- 158. Read N Characters Given Read4 II - Call Multiple Times 🔒
- 161. One Edit Distance 🔒
- 164. Maximum Gap
- 165. Compare Version Numbers
- 169. Majority Element
- 170. Two Sum III - Data structure design 🔒
- 186. Reverse Words in a String II 🔒
- 189. Rotate Array
- 205. Isomorphic Strings
- 214. Shortest Palindrome
- 217. Contains Duplicate
- 219. Contains Duplicate II
- 229. Majority Element II
- 238. Product of Array Except Self
- 242. Valid Anagram
- 243. Shortest Word Distance 🔒
- 244. Shortest Word Distance II 🔒
- 245. Shortest Word Distance III 🔒
- 249. Group Shifted Strings 🔒
- 251. Flatten 2D Vector 🔒
- 266. Palindrome Permutation 🔒
- 271. Encode and Decode Strings 🔒
- 274. H-Index
- 281. Zigzag Iterator 🔒
- 284. Peeking Iterator
- 288. Unique Word Abbreviation 🔒
- 289. Game of Life
- 290. Word Pattern
- 293. Flip Game 🔒
- 299. Bulls and Cows
- 311. Sparse Matrix Multiplication 🔒
- 325. Maximum Size Subarray Sum Equals k 🔒
- 348. Design Tic-Tac-Toe 🔒
- 349. Intersection of Two Arrays
- 350. Intersection of Two Arrays II
- 353. Design Snake Game 🔒
- 359. Logger Rate Limiter 🔒
- 370. Range Addition 🔒
- 379. Design Phone Directory 🔒
- 383. Ransom Note
- 384. Shuffle an Array
- 387. First Unique Character in a String
- 398. Random Pick Index
- 408. Valid Word Abbreviation 🔒
- 412. Fizz Buzz
- 414. Third Maximum Number
- 415. Add Strings
- 418. Sentence Screen Fitting 🔒
- 419. Battleships in a Board
- 422. Valid Word Square 🔒
- 434. Number of Segments in a String
- 442. Find All Duplicates in an Array
- 443. String Compression
- 447. Number of Boomerangs
- 448. Find All Numbers Disappeared in an Array
- 454. 4Sum II
- 459. Repeated Substring Pattern
- 463. Island Perimeter
- 468. Validate IP Address
- 481. Magical String
- 482. License Key Formatting
- 485. Max Consecutive Ones
- 492. Construct the Rectangle
- 495. Teemo Attacking
- 498. Diagonal Traverse
- 500. Keyboard Row
2. Two Pointers
- 11. Container With Most Water
- 15. 3Sum
- 16. 3Sum Closest
- 18. 4Sum
- 26. Remove Duplicates from Sorted Array
- 27. Remove Element
- 42. Trapping Rain Water
- 75. Sort Colors
- 80. Remove Duplicates from Sorted Array II
- 88. Merge Sorted Array
- 125. Valid Palindrome
- 167. Two Sum II - Input Array Is Sorted
- 259. 3Sum Smaller 🔒
- 283. Move Zeroes
- 287. Find the Duplicate Number
- 344. Reverse String
- 345. Reverse Vowels of a String
- 360. Sort Transformed Array 🔒
- 392. Is Subsequence
- 457. Circular Array Loop
- 462. Minimum Moves to Equal Array Elements II
3. Sliding Window
- 3. Longest Substring Without Repeating Characters
- 30. Substring with Concatenation of All Words
- 76. Minimum Window Substring
- 159. Longest Substring with At Most Two Distinct Characters 🔒
- 187. Repeated DNA Sequences
- 209. Minimum Size Subarray Sum
- 220. Contains Duplicate III
- 239. Sliding Window Maximum
- 340. Longest Substring with At Most K Distinct Characters 🔒
- 346. Moving Average from Data Stream 🔒
- 362. Design Hit Counter 🔒
- 395. Longest Substring with At Least K Repeating Characters
- 424. Longest Repeating Character Replacement
- 438. Find All Anagrams in a String
- 480. Sliding Window Median
- 487. Max Consecutive Ones II 🔒
4. Stack
- 20. Valid Parentheses
- 71. Simplify Path
- 85. Maximal Rectangle
- 84. Largest Rectangle in Histogram
- 150. Evaluate Reverse Polish Notation
- 155. Min Stack
- 224. Basic Calculator
- 225. Implement Stack using Queues
- 227. Basic Calculator II
- 232. Implement Queue using Stacks
- 316. Remove Duplicate Letters
- 341. Flatten Nested List Iterator
- 385. Mini Parser
- 388. Longest Absolute File Path
- 394. Decode String
- 402. Remove K Digits
- 456. 132 Pattern
- 439. Ternary Expression Parser 🔒
- 496. Next Greater Element I
5. Binary Search
- 4. Median of Two Sorted Arrays
- 33. Search in Rotated Sorted Array
- 34. Find First and Last Position of Element in Sorted Array
- 35. Search Insert Position
- 69. Sqrt(x)
- 74. Search a 2D Matrix
- 81. Search in Rotated Sorted Array II
- 153. Find Minimum in Rotated Sorted Array
- 154. Find Minimum in Rotated Sorted Array II
- 162. Find Peak Element
- 240. Search a 2D Matrix II
- 275. H-Index II
- 278. First Bad Version
- 302. Smallest Rectangle Enclosing Black Pixels 🔒
- 367. Valid Perfect Square
- 374. Guess Number Higher or Lower
- 410. Split Array Largest Sum
- 436. Find Right Interval
- 441. Arranging Coins
- 475. Heaters
- 483. Smallest Good Base
6. Linked List
- 2. Add Two Numbers
- 19. Remove Nth Node From End of List
- 21. Merge Two Sorted Lists
- 24. Swap Nodes in Pairs
- 25. Reverse Nodes in k-Group
- 61. Rotate List
- 82. Remove Duplicates from Sorted List II
- 83. Remove Duplicates from Sorted List
- 86. Partition List
- 92. Reverse Linked List II
- 138. Copy List with Random Pointer
- 141. Linked List Cycle
- 142. Linked List Cycle II
- 143. Reorder List
- 146. LRU Cache
- 147. Insertion Sort List
- 148. Sort List
- 160. Intersection of Two Linked Lists
- 203. Remove Linked List Elements
- 206. Reverse Linked List
- 234. Palindrome Linked List
- 237. Delete Node in a Linked List
- 328. Odd Even Linked List
- 369. Plus One Linked List 🔒
- 382. Linked List Random Node
- 430. Flatten a Multilevel Doubly Linked List
- 445. Add Two Numbers II
- 460. LFU Cache
7. Trees
- 94. Binary Tree Inorder Traversal
- 95. Unique Binary Search Trees II
- 98. Validate Binary Search Tree
- 99. Recover Binary Search Tree
- 100. Same Tree
- 101. Symmetric Tree
- 102. Binary Tree Level Order Traversal
- 103. Binary Tree Zigzag Level Order Traversal
- 104. Maximum Depth of Binary Tree
- 105. Construct Binary Tree from Preorder and Inorder Traversal
- 106. Construct Binary Tree from Inorder and Postorder Traversal
- 107. Binary Tree Level Order Traversal II
- 108. Convert Sorted Array to Binary Search Tree
- 109. Convert Sorted List to Binary Search Tree
- 110. Balanced Binary Tree
- 111. Minimum Depth of Binary Tree
- 112. Path Sum
- 114. Flatten Binary Tree to Linked List
- 116. Populating Next Right Pointers in Each Node
- 117. Populating Next Right Pointers in Each Node II
- 124. Binary Tree Maximum Path Sum
- 129. Sum Root to Leaf Numbers
- 144. Binary Tree Preorder Traversal
- 145. Binary Tree Postorder Traversal
- 156. Binary Tree Upside Down 🔒
- 173. Binary Search Tree Iterator
- 199. Binary Tree Right Side View
- 222. Count Complete Tree Nodes
- 226. Invert Binary Tree
- 230. Kth Smallest Element in a BST
- 235. Lowest Common Ancestor of a Binary Search Tree
- 236. Lowest Common Ancestor of a Binary Tree
- 250. Count Univalue Subtrees 🔒
- 255. Verify Preorder Sequence in Binary Search Tree 🔒
- 257. Binary Tree Paths
- 270. Closest Binary Search Tree Value 🔒
- 272. Closest Binary Search Tree Value II 🔒
- 285. Inorder Successor in BST 🔒
- 297. Serialize and Deserialize Binary Tree
- 298. Binary Tree Longest Consecutive Sequence 🔒
- 307. Range Sum Query - Mutable
- 314. Binary Tree Vertical Order Traversal 🔒
- 331. Verify Preorder Serialization of a Binary Tree
- 333. Largest BST Subtree 🔒
- 337. House Robber III
- 366. Find Leaves of Binary Tree 🔒
- 404. Sum of Left Leaves
- 426. Convert Binary Search Tree to Sorted Doubly Linked List 🔒
- 427. Construct Quad Tree
- 428. Serialize and Deserialize N-ary Tree 🔒
- 429. N-ary Tree Level Order Traversal
- 431. Encode N-ary Tree to Binary Tree 🔒
- 437. Path Sum III
- 449. Serialize and Deserialize BST
- 450. Delete Node in a BST
- 493. Reverse Pairs
8. Heap / Priority Queue
- 23. Merge k Sorted Lists
- 215. Kth Largest Element in an Array
- 218. The Skyline Problem
- 264. Ugly Number II
- 295. Find Median from Data Stream
- 313. Super Ugly Number
- 315. Count of Smaller Numbers After Self
- 327. Count of Range Sum
- 347. Top K Frequent Elements
- 355. Design Twitter
- 358. Rearrange String k Distance Apart 🔒
- 373. Find K Pairs with Smallest Sums
- 378. Kth Smallest Element in a Sorted Matrix
- 407. Trapping Rain Water II
- 432. All One Data Structure
- 451. Sort Characters By Frequency
9. Backtracking
- 17. Letter Combinations of a Phone Number
- 22. Generate Parentheses
- 37. Sudoku Solver
- 39. Combination Sum
- 40. Combination Sum II
- 46. Permutations
- 47. Permutations II
- 51. N-Queens
- 52. N-Queens II
- 60. Permutation Sequence
- 77. Combinations
- 78. Subsets
- 79. Word Search
- 90. Subsets II
- 93. Restore IP Addresses
- 113. Path Sum II
- 131. Palindrome Partitioning
- 216. Combination Sum III
- 241. Different Ways to Add Parentheses
- 247. Strobogrammatic Number II 🔒
- 248. Strobogrammatic Number III 🔒
- 254. Factor Combinations 🔒
- 267. Palindrome Permutation II 🔒
- 282. Expression Add Operators
- 291. Word Pattern II 🔒
- 294. Flip Game II 🔒
- 301. Remove Invalid Parentheses
- 306. Additive Number
- 320. Generalized Abbreviation 🔒
- 351. Android Unlock Patterns 🔒
- 411. Minimum Unique Word Abbreviation 🔒
- 465. Optimal Account Balancing 🔒
- 473. Matchsticks to Square
- 488. Zuma Game
- 489. Robot Room Cleaner 🔒
- 491. Non-decreasing Subsequences
10. Tries
- 208. Implement Trie (Prefix Tree)
- 211. Design Add and Search Words Data Structure
- 212. Word Search II
- 336. Palindrome Pairs
- 386. Lexicographical Numbers
- 421. Maximum XOR of Two Numbers in an Array
- 425. Word Squares 🔒
- 440. K-th Smallest in Lexicographical Order
- 467. Unique Substrings in Wraparound String
- 472. Concatenated Words
11. Graphs
- 126. Word Ladder II
- 127. Word Ladder
- 130. Surrounded Regions
- 133. Clone Graph
- 200. Number of Islands
- 207. Course Schedule
- 210. Course Schedule II
- 261. Graph Valid Tree 🔒
- 277. Find the Celebrity 🔒
- 286. Walls and Gates 🔒
- 305. Number of Islands II 🔒
- 310. Minimum Height Trees
- 317. Shortest Distance from All Buildings 🔒
- 323. Number of Connected Components in an Undirected Graph 🔒
- 329. Longest Increasing Path in a Matrix
- 339. Nested List Weight Sum 🔒
- 364. Nested List Weight Sum II 🔒
- 399. Evaluate Division
- 417. Pacific Atlantic Water Flow
- 433. Minimum Genetic Mutation
- 444. Sequence Reconstruction 🔒
- 490. The Maze 🔒
12. Advanced Graphs
13. 1D Dynamic Programming
- 53. Maximum Subarray
- 70. Climbing Stairs
- 91. Decode Ways
- 96. Unique Binary Search Trees
- 123. Best Time to Buy and Sell Stock III
- 139. Word Break
- 140. Word Break II
- 152. Maximum Product Subarray
- 188. Best Time to Buy and Sell Stock IV
- 198. House Robber
- 213. House Robber II
- 256. Paint House 🔒
- 265. Paint House II 🔒
- 276. Paint Fence 🔒
- 279. Perfect Squares
- 300. Longest Increasing Subsequence
- 303. Range Sum Query - Immutable
- 309. Best Time to Buy and Sell Stock with Cooldown
- 322. Coin Change
- 343. Integer Break
- 368. Largest Divisible Subset
- 375. Guess Number Higher or Lower II
- 376. Wiggle Subsequence
- 377. Combination Sum IV
- 403. Frog Jump
- 413. Arithmetic Slices
- 416. Partition Equal Subset Sum
- 446. Arithmetic Slices II - Subsequence
- 464. Can I Win
- 474. Ones and Zeroes
- 486. Predict the Winner
- 494. Target Sum
14. 2D Dynamic Programming
- 5. Longest Palindromic Substring
- 10. Regular Expression Matching
- 32. Longest Valid Parentheses
- 44. Wildcard Matching
- 62. Unique Paths
- 63. Unique Paths II
- 64. Minimum Path Sum
- 72. Edit Distance
- 87. Scramble String
- 97. Interleaving String
- 115. Distinct Subsequences
- 120. Triangle
- 132. Palindrome Partitioning II
- 174. Dungeon Game
- 221. Maximal Square
- 304. Range Sum Query 2D - Immutable
- 308. Range Sum Query 2D - Mutable 🔒
- 312. Burst Balloons
- 354. Russian Doll Envelopes
- 361. Bomb Enemy 🔒
- 363. Max Sum of Rectangle No Larger Than K
- 471. Encode String with Shortest Length 🔒
15. Greedy
- 45. Jump Game II
- 55. Jump Game
- 68. Text Justification
- 121. Best Time to Buy and Sell Stock
- 122. Best Time to Buy and Sell Stock II
- 134. Gas Station
- 135. Candy
- 179. Largest Number
- 280. Wiggle Sort 🔒
- 321. Create Maximum Number
- 324. Wiggle Sort II
- 330. Patching Array
- 334. Increasing Triplet Subsequence
- 380. Insert Delete GetRandom O(1)
- 381. Insert Delete GetRandom O(1) - Duplicates allowed
- 406. Queue Reconstruction by Height
- 420. Strong Password Checker
- 455. Assign Cookies
- 484. Find Permutation 🔒
16. Intervals
- 56. Merge Intervals
- 57. Insert Interval
- 163. Missing Ranges 🔒
- 228. Summary Ranges
- 252. Meeting Rooms 🔒
- 253. Meeting Rooms II 🔒
- 352. Data Stream as Disjoint Intervals
- 391. Perfect Rectangle
- 435. Non-overlapping Intervals
- 452. Minimum Number of Arrows to Burst Balloons
17. Math & Geometry
- 7. Reverse Integer
- 8. String to Integer (atoi)
- 9. Palindrome Number
- 12. Integer to Roman
- 13. Roman to Integer
- 29. Divide Two Integers
- 43. Multiply Strings
- 50. Pow(x, n)
- 67. Add Binary
- 149. Max Points on a Line
- 166. Fraction to Recurring Decimal
- 168. Excel Sheet Column Title
- 171. Excel Sheet Column Number
- 172. Factorial Trailing Zeroes
- 202. Happy Number
- 204. Count Primes
- 223. Rectangle Area
- 233. Number of Digit One
- 246. Strobogrammatic Number 🔒
- 258. Add Digits
- 263. Ugly Number
- 273. Integer to English Words
- 292. Nim Game
- 296. Best Meeting Point 🔒
- 319. Bulb Switcher
- 326. Power of Three
- 335. Self Crossing
- 356. Line Reflection 🔒
- 357. Count Numbers with Unique Digits
- 365. Water and Jug Problem
- 372. Super Pow
- 390. Elimination Game
- 396. Rotate Function
- 400. Nth Digit
- 405. Convert a Number to Hexadecimal
- 423. Reconstruct Original Digits from English
- 453. Minimum Moves to Equal Array Elements
- 458. Poor Pigs
- 469. Convex Polygon 🔒
- 470. Implement Rand10() Using Rand7()
- 478. Generate Random Point in a Circle
- 479. Largest Palindrome Product
- 497. Random Point in Non-overlapping Rectangles
18. Bit Manipulation
- 89. Gray Code
- 136. Single Number
- 137. Single Number II
- 190. Reverse Bits
- 191. Number of 1 Bits
- 201. Bitwise AND of Numbers Range
- 231. Power of Two
- 260. Single Number III
- 268. Missing Number
- 318. Maximum Product of Word Lengths
- 338. Counting Bits
- 342. Power of Four
- 371. Sum of Two Integers
- 389. Find the Difference
- 393. UTF-8 Validation
- 397. Integer Replacement
- 401. Binary Watch
- 461. Hamming Distance
- 476. Number Complement
- 477. Total Hamming Distance
19. SQL
- 175. Combine Two Tables
- 176. Second Highest Salary
- 177. Nth Highest Salary
- 178. Rank Scores
- 180. Consecutive Numbers
- 181. Employees Earning More Than Their Managers
- 182. Duplicate Emails
- 183. Customers Who Never Order
- 184. Department Highest Salary
- 185. Department Top Three Salaries
- 196. Delete Duplicate Emails
- 197. Rising Temperature
- 262. Trips and Users