தீர்வுகள்
LeetCode தீர்வுகள், படிப்படியாக விளக்கப்பட்டவை
நான் தீர்த்த 310 பிராப்ளம்கள் — ஒவ்வொன்றிலும் intuition, approach, என் accepted கோட், complexity, animated test cases மற்றும் line-by-line debugger.
தீர்வு விளக்கங்கள் ஆங்கிலத்தில் உள்ளன.
Array42
Hashing / Anagram
- 1. Two Sumஎளிது
- 217. Contains Duplicateஎளிது
- 242. Valid Anagramஎளிது
- 350. Intersection of Two Arrays IIஎளிது
- 268. Missing Numberஎளிது
- 136. Single Numberஎளிது
- 49. Group Anagramsநடுத்தரம்
- 128. Longest Consecutive Sequenceநடுத்தரம்
Prefix Sum
- 238. Product of Array Except Selfநடுத்தரம்
- 560. Subarray Sum Equals Kநடுத்தரம்
- 523. Continuous Subarray Sumநடுத்தரம்
Two Pointers
- 202. Happy Numberஎளிது
- 88. Merge Sorted Arrayஎளிது
- 283. Move Zeroesஎளிது
- 26. Remove Duplicates from Sorted Arrayஎளிது
- 27. Remove Elementஎளிது
- 125. Valid Palindromeஎளிது
- 167. Two Sum II - Input Array Is Sortedநடுத்தரம்
- 15. 3Sumநடுத்தரம்
- 16. 3Sum Closestநடுத்தரம்
- 18. 4Sumநடுத்தரம்
- 11. Container With Most Waterநடுத்தரம்
- 31. Next Permutationநடுத்தரம்
- 80. Remove Duplicates from Sorted Array IIநடுத்தரம்
- 189. Rotate Arrayநடுத்தரம்
- 75. Sort Colorsநடுத்தரம்
- 42. Trapping Rain Waterகடினம்
Kadane
- 53. Maximum Subarrayநடுத்தரம்
Matrix
- 48. Rotate Imageநடுத்தரம்
- 73. Set Matrix Zeroesநடுத்தரம்
- 54. Spiral Matrixநடுத்தரம்
- 36. Valid Sudokuநடுத்தரம்
- 289. Game of Lifeநடுத்தரம்
Sorting
- 56. Merge Intervalsநடுத்தரம்
Cyclic Sort / Index Marking
- 287. Find the Duplicate Numberநடுத்தரம்
- 41. First Missing Positiveகடினம்
Counting Sort
- 274. H-Indexநடுத்தரம்
Moore Voting
- 169. Majority Elementஎளிது
- 229. Majority Element IIநடுத்தரம்
Linear Scan
Design
- 380. Insert Delete GetRandom O(1)நடுத்தரம்
String18
Two Pointers
- 344. Reverse Stringஎளிது
- 680. Valid Palindrome IIஎளிது
- 392. Is Subsequenceஎளிது
- 151. Reverse Words in a Stringநடுத்தரம்
Palindrome / Expand Around Center
- 5. Longest Palindromic Substringநடுத்தரம்
String Matching (KMP / Rabin-Karp)
Hashing / Frequency
- 205. Isomorphic Stringsஎளிது
- 290. Word Patternஎளிது
Parsing / Conversion
- 13. Roman to Integerஎளிது
- 8. String to Integer (atoi)நடுத்தரம்
- 6. Zigzag Conversionநடுத்தரம்
- 165. Compare Version Numbersநடுத்தரம்
- 38. Count and Sayநடுத்தரம்
Math
- 50. Pow(x, n)நடுத்தரம்
- 7. Reverse Integerநடுத்தரம்
Prefix / Misc
Sliding Window
Sliding Window14
Fixed Window
- 219. Contains Duplicate IIஎளிது
- 438. Find All Anagrams in a Stringநடுத்தரம்
- 567. Permutation in Stringநடுத்தரம்
Variable Window – Longest
Variable Window – Shortest / Minimum
- 209. Minimum Size Subarray Sumநடுத்தரம்
Counting Subarrays (Exactly K = AtMost K − AtMost K−1)
Window + Hashing (Multi-word)
Monotonic Queue
Prefix / Circular Window
Binary Search20
Basics / Lower & Upper Bound
Rotated Sorted Array
Peak / Check Mid Sides
- 162. Find Peak Elementநடுத்தரம்
- 540. Single Element in a Sorted Arrayநடுத்தரம்
Binary Search on Answer
2D Matrix
- 74. Search a 2D Matrixநடுத்தரம்
- 240. Search a 2D Matrix IIநடுத்தரம்
Two Sorted Arrays / Partition
Math / Missing Numbers
Design
- 981. Time Based Key-Value Storeநடுத்தரம்
Linked List20
Basics
Fast & Slow Pointers
- 141. Linked List Cycleஎளிது
- 142. Linked List Cycle IIநடுத்தரம்
- 19. Remove Nth Node From End of Listநடுத்தரம்
Reversal
- 206. Reverse Linked Listஎளிது
- 92. Reverse Linked List IIநடுத்தரம்
- 61. Rotate Listநடுத்தரம்
- 25. Reverse Nodes in k-Groupகடினம்
Merge
Palindrome
Reordering / Partition
- 86. Partition Listநடுத்தரம்
Intersection
Deep Copy / Multilevel
- 138. Copy List with Random Pointerநடுத்தரம்
Design
- 146. LRU Cacheநடுத்தரம்
- 460. LFU Cacheகடினம்
Sorting
- 148. Sort Listநடுத்தரம்
Arithmetic
- 2. Add Two Numbersநடுத்தரம்
Stack & Queue18
Parentheses / Bracket Matching
Stack Simulation / String Processing
- 71. Simplify Pathநடுத்தரம்
- 1209. Remove All Adjacent Duplicates in String IIநடுத்தரம்
Expression Evaluation
- 150. Evaluate Reverse Polish Notationநடுத்தரம்
- 224. Basic Calculatorகடினம்
Stack / Queue Design
Iterator (Stack-based)
- 173. Binary Search Tree Iteratorநடுத்தரம்
Queue Simulation
Monotonic Stack – Next / Previous Greater or Smaller
- 496. Next Greater Element Iஎளிது
- 503. Next Greater Element IIநடுத்தரம்
Monotonic Stack – Greedy Removal
- 402. Remove K Digitsநடுத்தரம்
Monotonic Stack – Contribution / Area
Tree33
Traversals (Recursive / Iterative)
DFS Basics
Root-to-Leaf Paths
- 112. Path Sumஎளிது
- 129. Sum Root to Leaf Numbersநடுத்தரம்
BFS / Level Order
Lowest Common Ancestor / Distance
BST
Construction / Serialization
- 105. Construct Binary Tree from Preorder and Inorder Traversalநடுத்தரம்
- 106. Construct Binary Tree from Inorder and Postorder Traversalநடுத்தரம்
- 1008. Construct Binary Search Tree from Preorder Traversalநடுத்தரம்
- 114. Flatten Binary Tree to Linked Listநடுத்தரம்
- 297. Serialize and Deserialize Binary Treeகடினம்
Tree DP
Heap8
Top K
- 973. K Closest Points to Originநடுத்தரம்
- 215. Kth Largest Element in an Arrayநடுத்தரம்
- 347. Top K Frequent Elementsநடுத்தரம்
- 658. Find K Closest Elementsநடுத்தரம்
Two Heaps
- 295. Find Median from Data Streamகடினம்
- 502. IPOகடினம்
K-way Merge
- 373. Find K Pairs with Smallest Sumsநடுத்தரம்
Greedy + Heap / Scheduling
- 621. Task Schedulerநடுத்தரம்
Recursion & Backtracking18
Recursion Basics
- 1922. Count Good Numbersநடுத்தரம்
Subsets
- 78. Subsetsநடுத்தரம்
- 90. Subsets IIநடுத்தரம்
Combinations
- 77. Combinationsநடுத்தரம்
- 39. Combination Sumநடுத்தரம்
- 40. Combination Sum IIநடுத்தரம்
- 216. Combination Sum IIIநடுத்தரம்
- 17. Letter Combinations of a Phone Numberநடுத்தரம்
Permutations
- 46. Permutationsநடுத்தரம்
- 47. Permutations IIநடுத்தரம்
- 60. Permutation Sequenceகடினம்
Generate / Build Strings
- 22. Generate Parenthesesநடுத்தரம்
Partitioning
- 131. Palindrome Partitioningநடுத்தரம்
Constraint Satisfaction
- 51. N-Queensகடினம்
- 52. N-Queens IIகடினம்
- 37. Sudoku Solverகடினம்
- 282. Expression Add Operatorsகடினம்
Grid Search / Backtracking DFS
- 79. Word Searchநடுத்தரம்
Greedy11
Sorting + Simple Greedy
- 455. Assign Cookiesஎளிது
- 12. Integer to Romanநடுத்தரம்
Jump / Reachability
- 55. Jump Gameநடுத்தரம்
- 45. Jump Game IIநடுத்தரம்
- 134. Gas Stationநடுத்தரம்
- 122. Best Time to Buy and Sell Stock IIநடுத்தரம்
Local Choice / Two-pass
- 135. Candyகடினம்
Intervals
- 228. Summary Rangesஎளிது
- 57. Insert Intervalநடுத்தரம்
- 435. Non-overlapping Intervalsநடுத்தரம்
- 452. Minimum Number of Arrows to Burst Balloonsநடுத்தரம்
Graph40
Graph Fundamentals / BFS
- 133. Clone Graphநடுத்தரம்
- 200. Number of Islandsநடுத்தரம்
Graph Fundamentals / DFS
- 733. Flood Fillஎளிது
- 841. Keys and Roomsநடுத்தரம்
- 1020. Number of Enclavesநடுத்தரம்
- 1466. Reorder Routes to Make All Paths Lead to the City Zeroநடுத்தரம்
- 130. Surrounded Regionsநடுத்தரம்
Graph Fundamentals / DFS + DSU
- 547. Number of Provincesநடுத்தரம்
Multi-Source BFS
- 542. 01 Matrixநடுத்தரம்
- 1162. As Far from Land as Possibleநடுத்தரம்
- 1765. Map of Highest Peakநடுத்தரம்
- 994. Rotting Orangesநடுத்தரம்
State-Space BFS
- 433. Minimum Genetic Mutationநடுத்தரம்
- 1926. Nearest Exit from Entrance in Mazeநடுத்தரம்
- 909. Snakes and Laddersநடுத்தரம்
Bipartite / 2-Coloring
- 785. Is Graph Bipartite?நடுத்தரம்
Topological Sort / DAG
- 207. Course Scheduleநடுத்தரம்
- 210. Course Schedule IIநடுத்தரம்
- 802. Find Eventual Safe Statesநடுத்தரம்
State-Space / Transformation BFS
- 399. Evaluate Divisionநடுத்தரம்
- 127. Word Ladderகடினம்
- 126. Word Ladder IIகடினம்
Shortest Path / Dijkstra
- 743. Network Delay Timeநடுத்தரம்
- 1976. Number of Ways to Arrive at Destinationநடுத்தரம்
- 1631. Path With Minimum Effortநடுத்தரம்
Shortest Path / Floyd-Warshall
Minimum Spanning Tree
Union Find / DSU
Bridges / Articulation Points
Graph DP
Shortest Path / BFS-Dijkstra
- 787. Cheapest Flights Within K Stopsநடுத்தரம்
- 1091. Shortest Path in Binary Matrixநடுத்தரம்
Graph Fundamentals / DFS-BFS
- 1971. Find if Path Exists in Graphஎளிது
- 695. Max Area of Islandநடுத்தரம்
- 417. Pacific Atlantic Water Flowநடுத்தரம்
Dynamic Programming52
1D / Fibonacci
- 70. Climbing Stairsஎளிது
- 509. Fibonacci Numberஎளிது
- 746. Min Cost Climbing Stairsஎளிது
- 198. House Robberநடுத்தரம்
- 213. House Robber IIநடுத்தரம்
Kadane / Subarray DP
- 152. Maximum Product Subarrayநடுத்தரம்
- 918. Maximum Sum Circular Subarrayநடுத்தரம்
State Machine / Stocks
Grid DP
- 3418. Maximum Amount of Money Robot Can Earnநடுத்தரம்
- 931. Minimum Falling Path Sumநடுத்தரம்
- 64. Minimum Path Sumநடுத்தரம்
- 62. Unique Pathsநடுத்தரம்
- 63. Unique Paths IIநடுத்தரம்
Triangle / Pascal
- 118. Pascal's Triangleஎளிது
- 119. Pascal's Triangle IIஎளிது
- 120. Triangleநடுத்தரம்
0/1 Knapsack / Subset Sum
- 416. Partition Equal Subset Sumநடுத்தரம்
- 494. Target Sumநடுத்தரம்
Unbounded Knapsack
- 322. Coin Changeநடுத்தரம்
- 518. Coin Change IIநடுத்தரம்
- 279. Perfect Squaresநடுத்தரம்
String DP / Word Break
- 91. Decode Waysநடுத்தரம்
- 97. Interleaving Stringநடுத்தரம்
- 139. Word Breakநடுத்தரம்
- 472. Concatenated Wordsகடினம்
- 72. Edit Distanceநடுத்தரம்
- 698. Partition to K Equal Sum Subsetsநடுத்தரம்
- 44. Wildcard Matchingகடினம்
- 140. Word Break IIகடினம்
LCS
- 583. Delete Operation for Two Stringsநடுத்தரம்
- 1143. Longest Common Subsequenceநடுத்தரம்
- 516. Longest Palindromic Subsequenceநடுத்தரம்
- 718. Maximum Length of Repeated Subarrayநடுத்தரம்
- 115. Distinct Subsequencesகடினம்
- 1312. Minimum Insertion Steps to Make a String Palindromeகடினம்
- 1092. Shortest Common Supersequenceகடினம்
LIS
Palindrome / Interval DP
- 647. Palindromic Substringsநடுத்தரம்
- 132. Palindrome Partitioning IIகடினம்
DP on Squares / Matrix
- 1277. Count Square Submatrices with All Onesநடுத்தரம்
- 221. Maximal Squareநடுத்தரம்
Game DP
- 1025. Divisor Gameஎளிது
- 877. Stone Gameநடுத்தரம்
DP on Array
- 403. Frog Jumpகடினம்
Top Interview 15012
Other
- 222. Count Complete Tree Nodesநடுத்தரம்
- 58. Length of Last Wordஎளிது
- 9. Palindrome Numberஎளிது
- 66. Plus Oneஎளிது
- 383. Ransom Noteஎளிது
- 427. Construct Quad Treeநடுத்தரம்
- 172. Factorial Trailing Zeroesநடுத்தரம்
- 117. Populating Next Right Pointers in Each Node IIநடுத்தரம்
- 149. Max Points on a Lineகடினம்
- 68. Text Justificationகடினம்