🧩 Coding Challenges
Pick a topic and work through it — solve, get instant feedback, master it.
Array
49 challenges · 18 easy · 24 med · 7 hard
- 1. Two Sum — Easy
- 2. Best Time to Buy and Sell Stock — Easy
- 3. Contains Duplicate — Easy
- 5. Maximum Subarray — Easy
- 18. Majority Element — Easy
- 109. Pascal's Triangle — Easy
- 112. Remove Duplicates from Sorted Array — Easy
- 113. Move Zeroes — Easy
- 116. Degree of an Array — Easy
- 201. Help the Dog Find Its Bone — Easy
- 205. Potion Shop — Can I Afford It? — Easy
- 206. Highest Score on the Leaderboard — Easy
- 209. Dragon's Gold Counter — Easy
- 212. Magic Sorting Hat — Assign Houses — Easy
- 213. Remove Duplicate Inventory Items — Easy
- 217. Flatten the Dungeon Map — Easy
- 223. Rotate the Carousel — Easy
- 224. Unique Quest Items — Easy
- 4. Product of Array Except Self — Medium
- 6. Merge Intervals — Medium
- 7. Rotate Array — Medium
- 8. Find Minimum in Rotated Sorted Array — Medium
- 9. 3Sum — Medium
- 10. 4Sum — Medium
- 11. Container With Most Water — Medium
- 17. Subarray Sum Equals K — Medium
- 19. Sort Colors — Medium
- 20. Next Permutation — Medium
- 101. Spiral Matrix — Medium
- 102. Set Matrix Zeroes — Medium
- 103. Rotate Image — Medium
- 104. Search a 2D Matrix — Medium
- 105. Maximum Product Subarray — Medium
- 106. Find All Duplicates in an Array — Medium
- 107. Jump Game II — Medium
- 108. Minimum Size Subarray Sum — Medium
- 110. Gas Station — Medium
- 115. Maximum Sum Circular Subarray — Medium
- 117. Longest Turbulent Subarray — Medium
- 118. Max Consecutive Ones III — Medium
- 119. Minimum Number of Arrows to Burst Balloons — Medium
- 120. Non-overlapping Intervals — Medium
- 12. Trapping Rain Water — Hard
- 13. First Missing Positive — Hard
- 14. Largest Rectangle in Histogram — Hard
- 15. Median of Two Sorted Arrays — Hard
- 16. Sliding Window Maximum — Hard
- 111. Candy — Hard
- 114. Count of Smaller Numbers After Self — Hard
Backtracking
17 challenges · 1 easy · 13 med · 3 hard
- 187. Binary Watch — Easy
- 80. Permutations — Medium
- 81. Subsets — Medium
- 82. Combination Sum — Medium
- 83. Palindrome Partitioning — Medium
- 84. Letter Combinations of a Phone Number — Medium
- 86. Word Search — Medium
- 180. Subsets II — Medium
- 181. Permutations II — Medium
- 182. Combination Sum II — Medium
- 183. Combination Sum III — Medium
- 184. Beautiful Arrangement — Medium
- 185. Restore IP Addresses — Medium
- 186. Letter Case Permutation — Medium
- 85. N-Queens — Hard
- 87. Sudoku Solver — Hard
- 254. Sudoku Solver — Backtracking — Hard
Binary Search
5 challenges · 2 easy · 3 med
- 93. Sqrt(x) — Easy
- 230. XP to Next Level — Binary Search — Easy
- 94. Search in Rotated Sorted Array — Medium
- 95. Find Peak Element — Medium
- 199. Search a 2D Matrix II — Medium
Binary Tree
25 challenges · 10 easy · 12 med · 3 hard
- 46. Maximum Depth of Binary Tree — Easy
- 47. Same Tree — Easy
- 48. Invert Binary Tree — Easy
- 56. Subtree of Another Tree — Easy
- 57. Symmetric Tree — Easy
- 146. Path Sum — Easy
- 153. Convert Sorted Array to BST — Easy
- 154. Balanced Binary Tree — Easy
- 155. Diameter of Binary Tree — Easy
- 156. Range Sum of BST — Easy
- 49. Binary Tree Level Order Traversal — Medium
- 50. Validate Binary Search Tree — Medium
- 51. Kth Smallest Element in a BST — Medium
- 52. Lowest Common Ancestor of a Binary Tree — Medium
- 55. Construct Binary Tree from Preorder and Inorder — Medium
- 147. Path Sum II — Medium
- 148. Sum Root to Leaf Numbers — Medium
- 149. Binary Tree Right Side View — Medium
- 150. Count Complete Tree Nodes — Medium
- 151. Flatten Binary Tree to Linked List — Medium
- 152. Binary Tree Zigzag Level Order Traversal — Medium
- 157. All Nodes Distance K in Binary Tree — Medium
- 53. Binary Tree Maximum Path Sum — Hard
- 54. Serialize and Deserialize Binary Tree — Hard
- 247. Serialize and Deserialize Binary Tree — Hard
Bit Manipulation
3 challenges · 3 easy
- 88. Single Number — Easy
- 89. Number of 1 Bits — Easy
- 188. Power of Two — Easy
Breadth-First Search
1 challenge · 1 hard
Depth-First Search
2 challenges · 1 med · 1 hard
- 238. Number of Islands — Medium
- 243. Reconstruct Itinerary — Eulerian Path — Hard
Design
5 challenges · 2 easy · 3 med
- 195. Design HashMap — Easy
- 196. Design HashSet — Easy
- 96. Implement Trie — Medium
- 244. LRU Cache — O(1) Get and Put — Medium
- 245. Implement a Trie (Prefix Tree) — Medium
Divide and Conquer
1 challenge · 1 hard
Dynamic Programming
31 challenges · 1 easy · 18 med · 12 hard
- 58. Climbing Stairs — Easy
- 59. House Robber — Medium
- 60. Coin Change — Medium
- 61. Longest Increasing Subsequence — Medium
- 62. Unique Paths — Medium
- 63. Jump Game — Medium
- 64. Combination Sum IV — Medium
- 65. Decode Ways — Medium
- 69. Longest Common Subsequence — Medium
- 158. Triangle — Medium
- 159. Minimum Path Sum — Medium
- 161. Perfect Squares — Medium
- 162. Partition Equal Subset Sum — Medium
- 163. Target Sum — Medium
- 165. Palindromic Substrings — Medium
- 166. Ones and Zeroes — Medium
- 167. House Robber II — Medium
- 168. Maximal Square — Medium
- 169. Stone Game — Medium
- 66. Edit Distance — Hard
- 67. Best Time to Buy and Sell Stock IV — Hard
- 68. Burst Balloons — Hard
- 160. Dungeon Game — Hard
- 164. Interleaving String — Hard
- 231. Longest Increasing Subsequence — Hard
- 232. Edit Distance (Levenshtein Distance) — Hard
- 233. Burst Balloons — Hard
- 234. Palindrome Partitioning II — Minimum Cuts — Hard
- 235. Distinct Subsequences — Hard
- 237. Wildcard Pattern Matching — Hard
- 259. Maximum Profit with k Transactions — Hard
Graph
23 challenges · 1 easy · 17 med · 5 hard
- 174. Find the Town Judge — Easy
- 70. Number of Islands — Medium
- 71. Clone Graph — Medium
- 72. Course Schedule — Medium
- 73. Pacific Atlantic Water Flow — Medium
- 74. Graph Valid Tree — Medium
- 77. Network Delay Time — Medium
- 78. Cheapest Flights Within K Stops — Medium
- 170. Surrounded Regions — Medium
- 171. Number of Connected Components in an Undirected Graph — Medium
- 172. Redundant Connection — Medium
- 173. Is Graph Bipartite? — Medium
- 175. Evaluate Division — Medium
- 176. Minimum Height Trees — Medium
- 177. All Paths From Source to Target — Medium
- 178. Path With Minimum Effort — Medium
- 239. Course Schedule — Cycle Detection in Directed Graph — Medium
- 241. Network Delay Time — Dijkstra — Medium
- 75. Word Ladder — Hard
- 76. Alien Dictionary — Hard
- 79. Critical Connections in a Network — Hard
- 179. Swim in Rising Water — Hard
- 240. Alien Dictionary — Topological Sort — Hard
Greedy
2 challenges · 2 med
- 252. Jump Game II — Minimum Jumps — Medium
- 256. Task Scheduler — CPU Cooldown — Medium
Hash Table
3 challenges · 2 easy · 1 med
- 219. Word Count in a Story — Easy
- 222. Group Heroes by Class — Easy
- 257. Longest Consecutive Sequence — Medium
Heap
7 challenges · 5 med · 2 hard
- 99. Kth Largest Element in an Array — Medium
- 100. Top K Frequent Elements — Medium
- 198. Kth Smallest Element in a Sorted Matrix — Medium
- 253. Meeting Rooms II — Minimum Conference Rooms — Medium
- 255. K Closest Points to Origin — Medium
- 197. Find Median from Data Stream — Hard
- 246. Find Median from Data Stream — Hard
Linked List
20 challenges · 6 easy · 12 med · 2 hard
- 36. Reverse Linked List — Easy
- 37. Merge Two Sorted Lists — Easy
- 40. Linked List Cycle — Easy
- 136. Intersection of Two Linked Lists — Easy
- 137. Remove Duplicates from Sorted List — Easy
- 145. Palindrome Linked List — Easy
- 38. Add Two Numbers — Medium
- 39. Remove Nth Node From End of List — Medium
- 41. Linked List Cycle II — Medium
- 42. Reorder List — Medium
- 44. Copy List with Random Pointer — Medium
- 45. LRU Cache — Medium
- 138. Partition List — Medium
- 139. Rotate List — Medium
- 140. Swap Nodes in Pairs — Medium
- 141. Flatten a Multilevel Doubly Linked List — Medium
- 142. Sort List — Medium
- 144. Remove Duplicates from Sorted List II — Medium
- 43. Merge k Sorted Lists — Hard
- 143. Reverse Nodes in k-Group — Hard
Math
16 challenges · 10 easy · 6 med
- 90. Missing Number — Easy
- 91. Reverse Integer — Easy
- 190. Happy Number — Easy
- 192. Excel Sheet Column Number — Easy
- 202. Lemonade Stand Calculator — Easy
- 207. FizzBuzz Quest — Easy
- 211. Level Up! What's My New Stats? — Easy
- 220. Fibonacci Quest — First N Numbers — Easy
- 226. Mission Timer — Format Seconds — Easy
- 228. Treasure Chest Combinations — Easy
- 92. Pow(x, n) — Medium
- 189. Count Primes — Medium
- 191. Factorial Trailing Zeroes — Medium
- 1003. Cosine Similarity Between Two Vectors — Medium
- 1004. Precision, Recall, and F1 — Medium
- 1007. Top-K Retrieval by Cosine Similarity — Medium
Matrix
1 challenge · 1 easy
Sliding Window
3 challenges · 1 med · 2 hard
- 258. Find All Anagram Substrings — Medium
- 249. Sliding Window Maximum — Hard
- 250. Minimum Window Substring — Hard
Sorting
2 challenges · 1 easy · 1 med
- 216. Score Board Sorter — Easy
- 200. H-Index — Medium
Stack
7 challenges · 3 easy · 3 med · 1 hard
- 97. Min Stack — Easy
- 193. Implement Queue using Stacks — Easy
- 194. Implement Stack using Queues — Easy
- 98. Evaluate Reverse Polish Notation — Medium
- 248. Implement a Min Stack — Medium
- 1006. Evaluate a Postfix (RPN) Expression — Medium
- 236. Maximum Rectangle in Histogram — Hard
String
44 challenges · 20 easy · 16 med · 8 hard
- 21. Valid Anagram — Easy
- 22. Valid Palindrome — Easy
- 25. Palindrome Number — Easy
- 27. Longest Common Prefix — Easy
- 31. Valid Parentheses — Easy
- 121. Reverse String — Easy
- 124. Implement strStr() — Easy
- 132. Roman to Integer — Easy
- 134. Add Binary — Easy
- 135. Isomorphic Strings — Easy
- 203. Fix the Birthday Invitation — Easy
- 204. Count the Stars — Easy
- 208. Reverse the Hero's Name — Easy
- 210. Spell Check: Is It a Palindrome? — Easy
- 214. Translate to Pig Latin — Easy
- 218. Emoji Health Bar — Easy
- 221. Check the Magic Password — Easy
- 225. Title Case the Story — Easy
- 227. Anagram Detector — Easy
- 229. Snake Game — Find the Longest Run — Easy
- 23. Longest Substring Without Repeating Characters — Medium
- 24. Longest Palindromic Substring — Medium
- 26. Group Anagrams — Medium
- 28. String to Integer (atoi) — Medium
- 29. ZigZag Conversion — Medium
- 32. Generate Parentheses — Medium
- 34. Word Break — Medium
- 122. Reverse Words in a String — Medium
- 123. Count and Say — Medium
- 125. Longest Repeating Character Replacement — Medium
- 126. Decode String — Medium
- 127. Find All Anagrams in a String — Medium
- 128. Repeated DNA Sequences — Medium
- 131. Integer to Roman — Medium
- 133. Multiply Strings — Medium
- 1005. Tokenize an Arithmetic Expression — Medium
- 30. Minimum Window Substring — Hard
- 33. Longest Valid Parentheses — Hard
- 35. Regular Expression Matching — Hard
- 129. Text Justification — Hard
- 130. Wildcard Matching — Hard
- 1001. Constant-Time String Compare — Hard
- 1002. XOR Decryption: Single-Byte Key — Hard
- 1008. Recursive Text Splitter (RAG Chunker) — Hard
Two Pointers
1 challenge · 1 hard
- 251. Trapping Rain Water — Hard