Repository for leetcode problems and solutions.
Solved leetcode problems and solutions.
| Status | Problem | Difficulty | Source |
|---|---|---|---|
| β | 1. Two Sum | π Easy | π |
| β | 2. Add Two Numbers | π Medium | π |
| β | 3. Longest Substring Without Repeating Characters | π Medium | π |
| β | 4. Median of Two Sorted Arrays | β€οΈ Hard | π |
| β | 5. Longest Palindromic Substring | π Medium | π |
| β | 6. Zigzag Conversion | π Medium | π |
| β | 7. Reverse Integer | π Medium | π |
| β | 8. String to Integer (atoi) | π Medium | π |
| β | 9. Palindrome Number | π Easy | π |
| π§ | 10. Regular Expression Matching | β€οΈ Hard | π |
| β | 11. Container With Most Water | π Medium | π |
| β | 12. Integer to Roman | π Medium | π |
| β | 13. Roman to Integer | π Easy | π |
| β | 14. Longest Common Prefix | π Easy | π |
| β | 15. 3Sum | π Medium | π |
| β | 17. Letter Combinations of a Phone Number | π Medium | π |
| β | 19. Remove Nth Node From End of List | π Medium | π |
| β | 20. Valid Parentheses | π Easy | π |
| β | 21. Merge Two Sorted Lists | π Easy | π |
| β | 23. Merge k Sorted Lists | β€οΈ Hard | π |
| β | 24. Swap Nodes in Pairs | π Medium | π |
| β | 25. Reverse Nodes in k-Group | β€οΈ Hard | π |
| β | 26. Remove Duplicates from Sorted Array | π Easy | π |
| β | 27. Remove Element | π Easy | π |
| β | 28. Find the Index of the First Occurrence in a String | π Easy | π |
| β | 29. Divide Two Integers | π Medium | π |
| β | 33. Search in Rotated Sorted Array | π Medium | π |
| β | 34. Find First and Last Position of Element in Sorted Array | π Medium | π |
| β | 35. Search Insert Position | π Easy | π |
| β | 36. Valid Sudoku | π Medium | π |
| β | 38. Count and Say | π Medium | π |
| β | 39. Combination Sum | π Medium | π |
| β | 40. Combination Sum II | π Medium | π |
| β | 41. First Missing Positive | β€οΈ Hard | π |
| β | 42. Trapping Rain Water | β€οΈ Hard | π |
| β | 46. Permutations | π Medium | π |
| β | 47. Permutations II | π Medium | π |
| β | 49. Group Anagrams | π Medium | π |
| β | 50. Pow(x, n) | π Medium | π |
| β | 53. Maximum Subarray | π Medium | π |
| β | 54. Spiral Matrix | π Medium | π |
| β | 55. Jump Game | π Medium | π |
| β | 56. Merge Intervals | π Medium | π |
| β | 57. Insert Interval | π Medium | π |
| β | 58. Length of Last Word | π Easy | π |
| β | 59. Spiral Matrix II | π Medium | π |
| β | 61. Rotate List | π Medium | π |
| β | 64. Minimum Path Sum | π Medium | π |
| β | 65. Valid Number | β€οΈ Hard | π |
| β | 66. Plus One | π Easy | π |
| β | 67. Add Binary | π Easy | π |
| β | 69. Sqrt(x) | π Easy | π |
| β | 70. Climbing Stairs | π Easy | π |
| β | 71. Simplify Path | π Medium | π |
| β | 73. Set Matrix Zeroes | π Medium | π |
| β | 74. Search a 2D Matrix | π Medium | π |
| β | 75. Sort Colors | π Medium | π |
| β | 76. Minimum Window Substring | β€οΈ Hard | π |
| β | 77. Combinations | π Medium | π |
| β | 78. Subsets | π Medium | π |
| β | 79. Word Search | π Medium | π |
| β | 82. Remove Duplicates from Sorted List II | π Medium | π |
| β | 83. Remove Duplicates from Sorted List | π Easy | π |
| β | 88. Merge Sorted Array | π Easy | π |
| β | 90. Subsets II | π Medium | π |
| β | 98. Validate Binary Search Tree | π Medium | π |
| β | 100. Same Tree | π Easy | π |
| β | 102. Binary Tree Level Order Traversal | π Medium | π |
| β | 104. Maximum Depth of Binary Tree | π Easy | π |
| β | 110. Balanced Binary Tree | π Easy | π |
| β | 112. Path Sum | π Easy | π |
| β | 118. Pascal's Triangle | π Easy | π |
| β | 119. Pascal's Triangle II | π Easy | π |
| β | 121. Best Time to Buy and Sell Stock | π Easy | π |
| β | 125. Valid Palindrome | π Easy | π |
| β | 128. Longest Consecutive Sequence | π Medium | π |
| β | 130. Surrounded Regions | π Medium | π |
| β | 133. Clone Graph | π Medium | π |
| β | 136. Single Number | π Easy | π |
| β | 138. Copy List with Random Pointer | π Medium | π |
| β | 141. Linked List Cycle | π Easy | π |
| β | 142. Linked List Cycle II | π Medium | π |
| β | 143. Reorder List | π Medium | π |
| β | 144. Binary Tree Preorder Traversal | π Easy | π |
| β | 145. Binary Tree Postorder Traversal | π Easy | π |
| β | 146. LRU Cache | π Medium | π |
| β | 148. Sort List | π Medium | π |
| β | 150. Evaluate Reverse Polish Notation | π Medium | π |
| β | 151. Reverse Words in a String | π Medium | π |
| β | 153. Find Minimum in Rotated Sorted Array | π Medium | π |
| β | 155. Min Stack | π Medium | π |
| β | 157. Read N Characters Given Read4 | π Easy | π |
| β | 160. Intersection of Two Linked Lists | π Easy | π |
| β | 167. Two Sum II - Input Array Is Sorted | π Medium | π |
| β | 169. Majority Element | π Easy | π |
| β | 170. Two Sum III - Data structure design | π Easy | π |
| β | 171. Excel Sheet Column Number | π Easy | π |
| β | 173. Binary Search Tree Iterator | π Medium | π |
| β | 175. Combine Two Tables | π Easy | π |
| β | 181. Employees Earning More Than Their Managers | π Easy | π |
| β | 189. Rotate Array | π Medium | π |
| β | 190. Reverse Bits | π Easy | π |
| β | 191. Number of 1 Bits | π Easy | π |
| β | 197. Rising Temperature | π Easy | π |
| β | 198. House Robber | π Medium | π |
| β | 199. Binary Tree Right Side View | π Medium | π |
| β | 200. Number of Islands | π Medium | π |
| β | 202. Happy Number | π Easy | π |
| β | 203. Remove Linked List Elements | π Easy | π |
| β | 205. Isomorphic Strings | π Easy | π |
| β | 206. Reverse Linked List | π Easy | π |
| β | 207. Course Schedule | π Medium | π |
| β | 208. Implement Trie (Prefix Tree) | π Medium | π |
| β | 209. Minimum Size Subarray Sum | π Medium | π |
| β | 210. Course Schedule II | π Medium | π |
| β | 213. House Robber II | π Medium | π |
| β | 215. Kth Largest Element in an Array | π Medium | π |
| β | 217. Contains Duplicate | π Easy | π |
| β | 219. Contains Duplicate II | π Easy | π |
| β | 222. Count Complete Tree Nodes | π Easy | π |
| β | 225. Implement Stack using Queues | π Easy | π |
| β | 226. Invert Binary Tree | π Easy | π |
| β | 228. Summary Ranges | π Easy | π |
| β | 229. Majority Element II | π Medium | π |
| β | 230. Kth Smallest Element in a BST | π Medium | π |
| β | 231. Power of Two | π Easy | π |
| β | 232. Implement Queue using Stacks | π Easy | π |
| β | 234. Palindrome Linked List | π Easy | π |
| β | 235. Lowest Common Ancestor of a Binary Search Tree | π Medium | π |
| β | 236. Lowest Common Ancestor of a Binary Tree | π Medium | π |
| β | 238. Product of Array Except Self | π Medium | π |
| β | 239. Sliding Window Maximum | β€οΈ Hard | π |
| β | 242. Valid Anagram | π Easy | π |
| β | 251. Flatten 2D Vector | π Medium | π |
| β | 252. Meeting Rooms | π Medium | π |
| β | 253. Meeting Rooms II | π Medium | π |
| β | 268. Missing Number | π Easy | π |
| β | 271. Encode and Decode Strings | π Medium | π |
| β | 281. Zigzag Iterator | π Medium | π |
| β | 283. Move Zeroes | π Easy | π |
| β | 284. Peeking Iterator | π Medium | π |
| β | 286. Walls and Gates | π Medium | π |
| β | 287. Find the Duplicate Number | π Medium | π |
| β | 289. Game of Life | π Medium | π |
| β | 290. Word Pattern | π Easy | π |
| β | 295. Find Median from Data Stream | β€οΈ Hard | π |
| β | 300. Longest Increasing Subsequence | π Medium | π |
| β | 303. Range Sum Query - Immutable | π Easy | π |
| β | 326. Power of Three | π Easy | π |
| β | 338. Counting Bits | π Easy | π |
| β | 342. Power of Four | π Easy | π |
| β | 344. Reverse String | π Easy | π |
| β | 345. Reverse Vowels of a String | π Easy | π |
| β | 346. Moving Average from Data Stream | π Easy | π |
| β | 347. Top K Frequent Elements | π Medium | π |
| β | 348. Design Tic-Tac-Toe | π Medium | π |
| β | 353. Design Snake Game | π Medium | π |
| β | 355. Design Twitter | π Medium | π |
| β | 359. Logger Rate Limiter | π Easy | π |
| β | 362. Design Hit Counter | π Medium | π |
| β | 374. Guess Number Higher or Lower | π Easy | π |
| β | 380. Insert Delete GetRandom O(1) | π Medium | π |
| β | 383. Ransom Note | π Easy | π |
| β | 389. Find the Difference | π Easy | π |
| β | 392. Is Subsequence | π Easy | π |
| β | 409. Longest Palindrome | π Easy | π |
| β | 412. Fizz Buzz | π Easy | π |
| β | 415. Add Strings | π Easy | π |
| β | 417. Pacific Atlantic Water Flow | π Medium | π |
| β | 424. Longest Repeating Character Replacement | π Medium | π |
| β | 442. Find All Duplicates in an Array | π Medium | π |
| β | 449. Serialize and Deserialize BST | π Medium | π |
| β | 485. Max Consecutive Ones | π Easy | π |
| β | 487. Max Consecutive Ones II | π Medium | π |
| β | 496. Next Greater Element I | π Easy | π |
| β | 498. Diagonal Traverse | π Medium | π |
| β | 503. Next Greater Element II | π Medium | π |
| β | 507. Perfect Number | π Easy | π |
| β | 509. Fibonacci Number | π Easy | π |
| β | 543. Diameter of Binary Tree | π Easy | π |
| β | 557. Reverse Words in a String III | π Easy | π |
| β | 567. Permutation in String | π Medium | π |
| β | 572. Subtree of Another Tree | π Easy | π |
| β | 605. Can Place Flowers | π Easy | π |
| β | 607. Sales Person | π Easy | π |
| β | 621. Task Scheduler | π Medium | π |
| β | 643. Maximum Average Subarray I | π Easy | π |
| β | 692. Top K Frequent Words | π Medium | π |
| β | 695. Max Area of Island | π Medium | π |
| β | 700. Search in a Binary Tree | π Easy | π |
| β | 703. Kth Largest Element in a Stream | π Easy | π |
| β | 704. Binary Search | π Easy | π |
| β | 724. Find Pivot Index | π Easy | π |
| β | 739. Daily Temperatures | π Medium | π |
| β | 746. Min Cost Climbing Stairs | π Easy | π |
| β | 747. Largest Number At Least Twice of Others | π Easy | π |
| β | 821. Shortest Distance to a Character | π Easy | π |
| β | 853. Car Fleet | π Medium | π |
| β | 875. Koko Eating Bananas | π Medium | π |
| β | 876. Middle of the Linked List | π Easy | π |
| β | 933. Number of Recent Calls | π Easy | π |
| β | 941. Valid Mountain Array | π Easy | π |
| β | 973. K Closest Points to Origin | π Medium | π |
| β | 977. Squares of a Sorted Array | π Easy | π |
| β | 994. Rotting Oranges | π Medium | π |
| β | 1009. Complement of Base 10 Integer | π Easy | π |
| β | 1046. Last Stone Weight | π Easy | π |
| β | 1047. Remove All Adjacent Duplicates In String | π Easy | π |
| β | 1137. N-th Tribonacci Number | π Easy | π |
| β | 1154. Day of the Year | π Easy | π |
| β | 1160. Find Words That Can Be Formed by Characters | π Easy | π |
| β | 1166. Design File System | π Medium | π |
| β | 1207. Unique Number of Occurrences | π Easy | π |
| β | 1229. Meeting Scheduler | π Medium | π |
| β | 1265. Print Immutable Linked List in Reverse | π Medium | π |
| β | 1290. Convert Binary Number in a Linked List to Integer | π Easy | π |
| β | 1295. Find Numbers with Even Number of Digits | π Easy | π |
| β | 1346. Check If N and Its Double Exist | π Easy | π |
| β | 1351. Count Negative Numbers in a Sorted Matrix | π Easy | π |
| β | 1408. String Matching in an Array | π Easy | π |
| β | 1431. Kids With the Greatest Number of Candies | π Easy | π |
| β | 1448. Count Good Nodes in Binary Tree | π Medium | π |
| β | 1475. Final Prices With a Special Discount in a Shop | π Easy | π |
| β | 1513. Number of Substrings With Only 1s | π Medium | π |
| β | 1523. Count Odd Numbers in an Interval Range | π Easy | π |
| β | 1550. Three Consecutive Odds | π Easy | π |
| β | 1582. Special Positions in a Binary Matrix | π Easy | π |
| β | 1668. Maximum Repeating Substring | π Easy | π |
| β | 1768. Merge Strings Alternately | π Easy | π |
| β | 1790. Check if One String Swap Can Make Strings Equal | π Easy | π |
| β | 1800. Maximum Ascending Subarray Sum | π Easy | π |
| β | 1863. Sum of All Subset XOR Totals | π Easy | π |
| β | 1876. Substrings of Size Three with Distinct Characters | π Easy | π |
| β | 1910. Remove All Occurrences of a Substring | π Medium | π |
| β | 1920. Build Array from Permutation | π Easy | π |
| β | 1991. Find the Middle Index in Array | π Easy | π |
| β | 2011. Final Value of Variable After Performing Operations | π Easy | π |
| β | 2016. Maximum Difference Between Increasing Elements | π Easy | π |
| β | 2034. Stock Price Fluctuation | π Medium | π |
| β | 2043. Simple Bank System | π Medium | π |
| β | 2094. Finding 3-Digit Even Numbers | π Easy | π |
| β | 2109. Adding Spaces to a String | π Medium | π |
| β | 2115. Find All Possible Recipes from Given Supplies | π Medium | π |
| β | 2133. Check if Every Row and Column Contains All Numbers | π Easy | π |
| β | 2138. Divide a String Into Groups of Size k | π Easy | π |
| β | 2154. Keep Multiplying Found Values by Two | π Easy | π |
| β | 2185. Counting Words With a Given Prefix | π Easy | π |
| β | 2206. Divide Array Into Equal Pairs | π Easy | π |
| β | 2215. Find the Difference of Two Arrays | π Easy | π |
| β | 2235. Add Two Integers | π Easy | π |
| β | 2264. Largest 3-Same-Digit Number in String | π Easy | π |
| β | 2273. Find Resultant Array After Removing Anagrams | π Easy | π |
| β | 2315. Count Asterisks | π Easy | π |
| β | 2336. Smallest Number in Infinite Set | π Medium | π |
| β | 2401. Longest Nice Subarray | π Medium | π |
| β | 2469. Convert the Temperature | π Easy | π |
| β | 2570. Merge Two 2D Arrays by Summing Values | π Easy | π |
| β | 2639. Find the Width of Columns of a Grid | π Easy | π |
| β | 2648. Generate Fibonacci Sequence | π Easy | π |
| β | 2667. Create Hello World Function | π Easy | π |
| β | 2703. Return Length of Arguments Passed | π Easy | π |
| β | 2796. Repeat String | π Easy | π |
| β | 2843. Count Symmetric Integers | π Easy | π |
| β | 2894. Divisible and Non-divisible Sums Difference | π Easy | π |
| β | 2933. High-Access Employees | π Medium | π |
| β | 2942. Find Words Containing Character | π Easy | π |
| β | 3000. Maximum Area of Longest Diagonal Rectangle | π Easy | π |
| β | 3024. Type of Triangle | π Easy | π |
| β | 3136. Valid Word | π Easy | π |
| β | 3169. Count Days Without Meetings | π Medium | π |
| β | 3264. Final Array State After K Multiplication Operations I | π Easy | π |
| β | 3423. Maximum Difference Between Adjacent Elements in a Circular Array | π Easy | π |
| β | 3432. Count Partitions with Even Sum Difference | π Easy | π |
| β | 3442. Maximum Difference Between Even and Odd Frequency I | π Easy | π |
| β | 3452. Sum of Good Numbers | π Easy | π |
| β | 3461. Check If Digits Are Equal in String After Operations I | π Easy | π |
| β | 3531. Count Covered Buildings | π Medium | π |
| β | 3606. Coupon Code Validator | π Easy | π |
| β | 3683. Earliest Time to Finish One Task | π Easy | π |