সমাধান
LeetCode সমাধান, ধাপে ধাপে ব্যাখ্যা
আমার সমাধান করা 310টি প্রবলেম — প্রতিটিতে intuition, approach, আমার accepted কোড, complexity, animated test cases আর line-by-line debugger।
সমাধানের বিবরণ ইংরেজিতে।
Array42
Hashing / Anagram
Prefix 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
Counting Sort
- 274. H-Indexমাঝারি
Moore Voting
Linear Scan
Design
String18
Two Pointers
Palindrome / Expand Around Center
String Matching (KMP / Rabin-Karp)
Hashing / Frequency
Parsing / Conversion
Math
- 50. Pow(x, n)মাঝারি
- 7. Reverse Integerমাঝারি
Prefix / Misc
Sliding Window
Sliding Window14
Fixed Window
Variable Window – Longest
Variable Window – Shortest / Minimum
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
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
Linked List20
Basics
Fast & Slow Pointers
Reversal
Palindrome
Reordering / Partition
- 86. Partition Listমাঝারি
Intersection
Deep Copy / Multilevel
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
Expression Evaluation
Stack / Queue Design
Iterator (Stack-based)
Queue Simulation
Monotonic Stack – Next / Previous Greater or Smaller
Monotonic Stack – Greedy Removal
- 402. Remove K Digitsমাঝারি
Monotonic Stack – Contribution / Area
Tree33
Traversals (Recursive / Iterative)
DFS Basics
Root-to-Leaf Paths
BFS / Level Order
Lowest Common Ancestor / Distance
BST
Construction / Serialization
Heap8
Top K
Two Heaps
K-way Merge
Greedy + Heap / Scheduling
- 621. Task Schedulerমাঝারি
Recursion & Backtracking18
Recursion Basics
- 1922. Count Good Numbersমাঝারি
Subsets
- 78. Subsetsমাঝারি
- 90. Subsets IIমাঝারি
Combinations
Permutations
- 46. Permutationsমাঝারি
- 47. Permutations IIমাঝারি
- 60. Permutation Sequenceকঠিন
Generate / Build Strings
- 22. Generate Parenthesesমাঝারি
Partitioning
Constraint Satisfaction
Grid Search / Backtracking DFS
- 79. Word Searchমাঝারি
Greedy11
Sorting + Simple Greedy
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
Graph40
Graph Fundamentals / BFS
- 133. Clone Graphমাঝারি
- 200. Number of Islandsমাঝারি
Graph Fundamentals / DFS
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
Bipartite / 2-Coloring
- 785. Is Graph Bipartite?মাঝারি
Topological Sort / DAG
State-Space / Transformation BFS
Shortest Path / Dijkstra
Shortest Path / Floyd-Warshall
Minimum Spanning Tree
Union Find / DSU
Bridges / Articulation Points
Graph DP
Shortest Path / BFS-Dijkstra
Graph Fundamentals / DFS-BFS
Dynamic Programming52
1D / Fibonacci
Kadane / Subarray DP
State Machine / Stocks
Grid DP
Triangle / Pascal
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
LCS
LIS
Palindrome / Interval DP
DP on Squares / Matrix
Game DP
- 1025. Divisor Gameসহজ
- 877. Stone Gameমাঝারি
DP on Array
- 403. Frog Jumpকঠিন