Preferred structure for LEET CODE
To solve the LEET CODE, we follow LISTEN pattern (Leetcode - Listen)
L - Listen the problem (Read problem + examples + constraints carefully)
I - Identify the solutions (Brute Force -> Optimized)
S - Seek the pattern (HashMap, Sliding Window, DFS, DP, etc.)
T - Try Coding (Write clean code)
E - Edge cases + Evaluate (Test edge cases + Ensure Time and Space complexity)
N - Neat explanation (One-line pattern note + Time Complexity, Space Complexity explanation)
Phase I : The 35 Mandatory Problems (Grouped by Topic)
- Two Sum (Easy) 🔗 https://leetcode.com/problems/two-sum/
- Contains Duplicate (Easy) 🔗 https://leetcode.com/problems/contains-duplicate/
- Valid Anagram (Easy) 🔗 https://leetcode.com/problems/valid-anagram/
- Group Anagrams (Medium) 🔗 https://leetcode.com/problems/group-anagrams/
- Top K Frequent Elements (Medium) 🔗 https://leetcode.com/problems/top-k-frequent-elements/
- Product of Array Except Self (Medium) 🔗 https://leetcode.com/problems/product-of-array-except-self/
- Longest Consecutive Sequence (Medium) 🔗 https://leetcode.com/problems/longest-consecutive-sequence/
- Best Time to Buy and Sell Stock (Easy) 🔗 https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
- Valid Palindrome (Easy) 🔗 https://leetcode.com/problems/valid-palindrome/
- Longest Substring Without Repeating Characters (Medium) 🔗 https://leetcode.com/problems/longest-substring-without-repeating-characters/
- Container With Most Water (Medium) 🔗 https://leetcode.com/problems/container-with-most-water/
- 3Sum (Medium) 🔗 https://leetcode.com/problems/3sum/
- Move Zeroes (Easy) 🔗 https://leetcode.com/problems/move-zeroes/
- Reverse Linked List (Easy) 🔗 https://leetcode.com/problems/reverse-linked-list/
- Merge Two Sorted Lists (Easy) 🔗 https://leetcode.com/problems/merge-two-sorted-lists/
- Linked List Cycle (Easy) 🔗 https://leetcode.com/problems/linked-list-cycle/
- Middle of the Linked List (Easy) 🔗 https://leetcode.com/problems/middle-of-the-linked-list/
- Palindrome Linked List (Easy) 🔗 https://leetcode.com/problems/palindrome-linked-list/
- Valid Parentheses (Easy) 🔗 https://leetcode.com/problems/valid-parentheses/
- Reverse String (Easy) 🔗 https://leetcode.com/problems/reverse-string/
- Find the Index of the First Occurrence in a String (Easy) 🔗 https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/
- Longest Palindromic Substring (Medium) 🔗 https://leetcode.com/problems/longest-palindromic-substring/
- Binary Search (Easy) 🔗 https://leetcode.com/problems/binary-search/
- Search in Rotated Sorted Array (Medium) 🔗 https://leetcode.com/problems/search-in-rotated-sorted-array/
- Find Minimum in Rotated Sorted Array (Medium) 🔗 https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
- Maximum Depth of Binary Tree (Easy) 🔗 https://leetcode.com/problems/maximum-depth-of-binary-tree/
- Invert Binary Tree (Easy) 🔗 https://leetcode.com/problems/invert-binary-tree/
- Same Tree (Easy) 🔗 https://leetcode.com/problems/same-tree/
- Symmetric Tree (Easy) 🔗 https://leetcode.com/problems/symmetric-tree/
- Binary Tree Level Order Traversal (Medium) 🔗 https://leetcode.com/problems/binary-tree-level-order-traversal/
- Climbing Stairs (Easy) 🔗 https://leetcode.com/problems/climbing-stairs/
- Majority Element (Easy) 🔗 https://leetcode.com/problems/majority-element/
- Number of Islands (Medium) 🔗 https://leetcode.com/problems/number-of-islands/
- Merge Sorted Array (Easy) 🔗 https://leetcode.com/problems/merge-sorted-array/
- Find the Duplicate Number (Medium) 🔗 https://leetcode.com/problems/find-the-duplicate-number/
Phase II : The 35 Mandatory Problems (Grouped by Topic)
1. Advanced Sliding Window (6 problems)
- Minimum Window Substring (Hard) 🔗 https://leetcode.com/problems/minimum-window-substring/
- Longest Repeating Character Replacement (Medium) 🔗 https://leetcode.com/problems/longest-repeating-character-replacement/
- Sliding Window Maximum (Hard) 🔗 https://leetcode.com/problems/sliding-window-maximum/
- Find All Anagrams in a String (Medium) 🔗 https://leetcode.com/problems/find-all-anagrams-in-a-string/
- Trapping Rain Water (Hard) 🔗 https://leetcode.com/problems/trapping-rain-water/
- Longest Repeating Substring (or similar variant if needed)
2. Heaps / Priority Queue (5 problems)
- K Closest Points to Origin (Medium) 🔗 https://leetcode.com/problems/k-closest-points-to-origin/
- Merge K Sorted Lists (Hard) 🔗 https://leetcode.com/problems/merge-k-sorted-lists/
- Task Scheduler (Medium) 🔗 https://leetcode.com/problems/task-scheduler/
- Find Median from Data Stream (Hard) 🔗 https://leetcode.com/problems/find-median-from-data-stream/
- Top K Frequent Elements (Medium) — already in your 35, revise well
3. Graphs + BFS/DFS (7 problems)
- Number of Islands (Medium) — already in 35, revise
- Clone Graph (Medium) 🔗 https://leetcode.com/problems/clone-graph/
- Course Schedule (Medium) 🔗 https://leetcode.com/problems/course-schedule/
- Course Schedule II (Medium) 🔗 https://leetcode.com/problems/course-schedule-ii/
- Word Ladder (Hard) 🔗 https://leetcode.com/problems/word-ladder/
- Pacific Atlantic Water Flow (Medium) 🔗 https://leetcode.com/problems/pacific-atlantic-water-flow/
- Rotting Oranges (Medium) 🔗 https://leetcode.com/problems/rotting-oranges/
4. Dynamic Programming (Basics to Medium) (8 problems)
- House Robber (Medium) 🔗 https://leetcode.com/problems/house-robber/
- House Robber II (Medium) 🔗 https://leetcode.com/problems/house-robber-ii/
- Longest Increasing Subsequence (Medium) 🔗 https://leetcode.com/problems/longest-increasing-subsequence/
- Coin Change (Medium) 🔗 https://leetcode.com/problems/coin-change/
- Unique Paths (Medium) 🔗 https://leetcode.com/problems/unique-paths/
- Jump Game (Medium) 🔗 https://leetcode.com/problems/jump-game/
- Partition Equal Subset Sum (Medium) 🔗 https://leetcode.com/problems/partition-equal-subset-sum/
- Word Break (Medium) 🔗 https://leetcode.com/problems/word-break/
5. Advanced Trees / Trie / Backtracking (5 problems)
- Serialize and Deserialize Binary Tree (Hard) 🔗 https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
- Binary Tree Maximum Path Sum (Hard) 🔗 https://leetcode.com/problems/binary-tree-maximum-path-sum/
- Word Search (Medium) 🔗 https://leetcode.com/problems/word-search/
- Implement Trie (Prefix Tree) (Medium) 🔗 https://leetcode.com/problems/implement-trie-prefix-tree/
- LRU Cache (Medium) 🔗 https://leetcode.com/problems/lru-cache/ ← Very important
6. Other High-Frequency (4 problems)
- Merge Intervals (Medium) 🔗 https://leetcode.com/problems/merge-intervals/
- Meeting Rooms II (Medium) 🔗 https://leetcode.com/problems/meeting-rooms-ii/
- Median of Two Sorted Arrays (Hard) 🔗 https://leetcode.com/problems/median-of-two-sorted-arrays/
- Longest Palindromic Substring (Medium) — already in your 35, revise
_________________________________________________________________
Practice all of the following leetcode exercises in free time
001. Two Sum 🔗 https://leetcode.com/problems/two-sum/
002. Contains Duplicate 🔗 https://leetcode.com/problems/contains-duplicate/
003. Valid Anagram 🔗 https://leetcode.com/problems/valid-anagram/
004. Group Anagrams 🔗 https://leetcode.com/problems/group-anagrams/
005. Top K Frequent Elements 🔗 https://leetcode.com/problems/top-k-frequent-elements/
006. Product of Array Except Self 🔗 https://leetcode.com/problems/product-of-array-except-self/
007. Valid Sudoku 🔗 https://leetcode.com/problems/valid-sudoku/
008. Encode and Decode Strings 🔗 https://leetcode.com/problems/encode-and-decode-strings/
009. Longest Consecutive Sequence 🔗 https://leetcode.com/problems/longest-consecutive-sequence/
010. Valid Palindrome 🔗 https://leetcode.com/problems/valid-palindrome/
011. Longest Substring Without Repeating Characters 🔗 https://leetcode.com/problems/longest-substring-without-repeating-characters/
012. Minimum Window Substring 🔗 https://leetcode.com/problems/minimum-window-substring/
013. Permutation in String 🔗 https://leetcode.com/problems/permutation-in-string/
014. Find All Anagrams in a String 🔗 https://leetcode.com/problems/find-all-anagrams-in-a-string/
015. Longest Substring with At Most K Distinct Characters 🔗 https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/
016. Maximum Average Subarray I 🔗 https://leetcode.com/problems/maximum-average-subarray-i/
017. Sliding Window Maximum 🔗 https://leetcode.com/problems/sliding-window-maximum/
018. Best Time to Buy and Sell Stock 🔗 https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
019. 3Sum 🔗 https://leetcode.com/problems/3sum/
020. Container With Most Water 🔗 https://leetcode.com/problems/container-with-most-water/
021. Trapping Rain Water 🔗 https://leetcode.com/problems/trapping-rain-water/
022. Remove Duplicates from Sorted Array 🔗 https://leetcode.com/problems/remove-duplicates-from-sorted-array/
023. Remove Element 🔗 https://leetcode.com/problems/remove-element/
024. Move Zeroes 🔗 https://leetcode.com/problems/move-zeroes/
025. Sort Colors 🔗 https://leetcode.com/problems/sort-colors/
026. Sort an Array 🔗 https://leetcode.com/problems/sort-an-array/
027. Merge Sorted Array 🔗 https://leetcode.com/problems/merge-sorted-array/
028. Majority Element 🔗 https://leetcode.com/problems/majority-element/
029. Linked List Cycle 🔗 https://leetcode.com/problems/linked-list-cycle/
030. Linked List Cycle II 🔗 https://leetcode.com/problems/linked-list-cycle-ii/
031. Happy Number 🔗 https://leetcode.com/problems/happy-number/
032. Middle of the Linked List 🔗 https://leetcode.com/problems/middle-of-the-linked-list/
033. Palindrome Linked List 🔗 https://leetcode.com/problems/palindrome-linked-list/
034. Remove Nth Node From End of List 🔗 https://leetcode.com/problems/remove-nth-node-from-end-of-list/
035. Reorder List 🔗 https://leetcode.com/problems/reorder-list/
036. Reverse Linked List 🔗 https://leetcode.com/problems/reverse-linked-list/
037. Reverse Linked List II 🔗 https://leetcode.com/problems/reverse-linked-list-ii/
038. Merge Two Sorted Lists 🔗 https://leetcode.com/problems/merge-two-sorted-lists/
039. Merge K Sorted Lists 🔗 https://leetcode.com/problems/merge-k-sorted-lists/
040. Reverse Nodes in k-Group 🔗 https://leetcode.com/problems/reverse-nodes-in-k-group/
041. Swap Nodes in Pairs 🔗 https://leetcode.com/problems/swap-nodes-in-pairs/
042. Odd Even Linked List 🔗 https://leetcode.com/problems/odd-even-linked-list/
043. Find the Duplicate Number 🔗 https://leetcode.com/problems/find-the-duplicate-number/
044. Find All Duplicates in an Array 🔗 https://leetcode.com/problems/find-all-duplicates-in-an-array/
045. Find the Missing Number 🔗 https://leetcode.com/problems/find-the-missing-number/
046. First Missing Positive 🔗 https://leetcode.com/problems/first-missing-positive/
047. Find All Numbers Disappeared in an Array 🔗 https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
048. Subsets 🔗 https://leetcode.com/problems/subsets/
049. Subsets II 🔗 https://leetcode.com/problems/subsets-ii/
050. Permutations 🔗 https://leetcode.com/problems/permutations/
051. Permutations II 🔗 https://leetcode.com/problems/permutations-ii/
052. Combination Sum 🔗 https://leetcode.com/problems/combination-sum/
053. Combination Sum II 🔗 https://leetcode.com/problems/combination-sum-ii/
054. Letter Combinations of a Phone Number 🔗 https://leetcode.com/problems/letter-combinations-of-a-phone-number/
055. Generate Parentheses 🔗 https://leetcode.com/problems/generate-parentheses/
056. Palindrome Partitioning 🔗 https://leetcode.com/problems/palindrome-partitioning/
057. Word Search 🔗 https://leetcode.com/problems/word-search/
058. N-Queens 🔗 https://leetcode.com/problems/n-queens/
059. Sudoku Solver 🔗 https://leetcode.com/problems/sudoku-solver/
060. Word Search II 🔗 https://leetcode.com/problems/word-search-ii/
061. Merge Intervals 🔗 https://leetcode.com/problems/merge-intervals/
062. Insert Interval 🔗 https://leetcode.com/problems/insert-interval/
063. Meeting Rooms II 🔗 https://leetcode.com/problems/meeting-rooms-ii/
064. Non-overlapping Intervals 🔗 https://leetcode.com/problems/non-overlapping-intervals/
065. Number of Islands 🔗 https://leetcode.com/problems/number-of-islands/
066. Clone Graph 🔗 https://leetcode.com/problems/clone-graph/
067. Course Schedule 🔗 https://leetcode.com/problems/course-schedule/
068. Course Schedule II 🔗 https://leetcode.com/problems/course-schedule-ii/
069. Pacific Atlantic Water Flow 🔗 https://leetcode.com/problems/pacific-atlantic-water-flow/
070. Surrounded Regions 🔗 https://leetcode.com/problems/surrounded-regions/
071. Rotting Oranges 🔗 https://leetcode.com/problems/rotting-oranges/
072. Word Ladder 🔗 https://leetcode.com/problems/word-ladder/
073. Alien Dictionary 🔗 https://leetcode.com/problems/alien-dictionary/
074. Graph Valid Tree 🔗 https://leetcode.com/problems/graph-valid-tree/
075. Number of Connected Components in an Undirected Graph 🔗 https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/
076. Accounts Merge 🔗 https://leetcode.com/problems/accounts-merge/
077. Redundant Connection 🔗 https://leetcode.com/problems/redundant-connection/
078. Evaluate Division 🔗 https://leetcode.com/problems/evaluate-division/
079. Cheapest Flights Within K Stops 🔗 https://leetcode.com/problems/cheapest-flights-within-k-stops/
080. Network Delay Time 🔗 https://leetcode.com/problems/network-delay-time/
081. Reconstruct Itinerary 🔗 https://leetcode.com/problems/reconstruct-itinerary/
082. Find Eventual Safe States 🔗 https://leetcode.com/problems/find-eventual-safe-states/
083. Keys and Rooms 🔗 https://leetcode.com/problems/keys-and-rooms/
084. Jump Game 🔗 https://leetcode.com/problems/jump-game/
085. Jump Game II 🔗 https://leetcode.com/problems/jump-game-ii/
086. Jump Game III 🔗 https://leetcode.com/problems/jump-game-iii/
087. Jump Game IV 🔗 https://leetcode.com/problems/jump-game-iv/
088. Gas Station 🔗 https://leetcode.com/problems/gas-station/
089. Candy 🔗 https://leetcode.com/problems/candy/
090. Task Scheduler 🔗 https://leetcode.com/problems/task-scheduler/
091. Reorganize String 🔗 https://leetcode.com/problems/reorganize-string/
092. Rearrange String k Distance Apart 🔗 https://leetcode.com/problems/rearrange-string-k-distance-apart/
093. Hand of Straights 🔗 https://leetcode.com/problems/hand-of-straights/
094. Merge Triplets to Form Target Triplet 🔗 https://leetcode.com/problems/merge-triplets-to-form-target-triplet/
095. Car Pooling 🔗 https://leetcode.com/problems/car-pooling/
096. Meeting Rooms 🔗 https://leetcode.com/problems/meeting-rooms/
097. Meeting Rooms III 🔗 https://leetcode.com/problems/meeting-rooms-iii/
098. Kth Largest Element in an Array 🔗 https://leetcode.com/problems/kth-largest-element-in-an-array/
099. K Closest Points to Origin 🔗 https://leetcode.com/problems/k-closest-points-to-origin/
100. Find Median from Data Stream 🔗 https://leetcode.com/problems/find-median-from-data-stream/
101. Kth Largest Element in a Stream 🔗 https://leetcode.com/problems/kth-largest-element-in-a-stream/
102. Sort Characters By Frequency 🔗 https://leetcode.com/problems/sort-characters-by-frequency/
103. Connect n Ropes With Minimum Cost (premium) 🔗 premium problem
104. Top K Frequent Words 🔗 https://leetcode.com/problems/top-k-frequent-words/
105. Kth Largest Element in a Sorted Matrix (premium) 🔗 premium problem
106. K-diff Pairs in an Array 🔗 https://leetcode.com/problems/k-diff-pairs-in-an-array/
107. Kth Smallest Element in a Sorted Matrix 🔗 https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/
108. Kth Smallest Number in Multiplication Table 🔗 https://leetcode.com/problems/kth-smallest-number-in-multiplication-table/
109. Kth Smallest Prime Fraction 🔗 https://leetcode.com/problems/kth-smallest-prime-fraction/
110. Kth Smallest Sum of Matrix With Sorted Rows (premium) 🔗 premium problem
111. Longest Increasing Subsequence 🔗 https://leetcode.com/problems/longest-increasing-subsequence/
112. Longest Common Subsequence 🔗 https://leetcode.com/problems/longest-common-subsequence/
113. Longest Palindromic Substring 🔗 https://leetcode.com/problems/longest-palindromic-substring/
114. Longest Palindromic Subsequence 🔗 https://leetcode.com/problems/longest-palindromic-subsequence/
115. Palindromic Substrings 🔗 https://leetcode.com/problems/palindromic-substrings/
116. Count Different Palindromic Subsequences 🔗 https://leetcode.com/problems/count-different-palindromic-subsequences/
117. Best Time to Buy and Sell Stock II 🔗 https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
118. Best Time to Buy and Sell Stock with Cooldown 🔗 https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/
119. Best Time to Buy and Sell Stock with Transaction Fee 🔗 https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
120. Partition Equal Subset Sum 🔗 https://leetcode.com/problems/partition-equal-subset-sum/
121. Partition to K Equal Sum Subsets 🔗 https://leetcode.com/problems/partition-to-k-equal-sum-subsets/
122. Target Sum 🔗 https://leetcode.com/problems/target-sum/
123. Ones and Zeroes 🔗 https://leetcode.com/problems/ones-and-zeroes/
124. Number of 1 Bits 🔗 https://leetcode.com/problems/number-of-1-bits/
125. Counting Bits 🔗 https://leetcode.com/problems/counting-bits/
126. Reverse Bits 🔗 https://leetcode.com/problems/reverse-bits/
127. Missing Number 🔗 https://leetcode.com/problems/missing-number/
128. Single Number 🔗 https://leetcode.com/problems/single-number/
129. Single Number II 🔗 https://leetcode.com/problems/single-number-ii/
130. Single Number III 🔗 https://leetcode.com/problems/single-number-iii/
131. Find the Duplicate Number 🔗 https://leetcode.com/problems/find-the-duplicate-number/
132. Find Peak Element 🔗 https://leetcode.com/problems/find-peak-element/
133. Search in Rotated Sorted Array 🔗 https://leetcode.com/problems/search-in-rotated-sorted-array/
134. Search in Rotated Sorted Array II 🔗 https://leetcode.com/problems/search-in-rotated-sorted-array-ii/
135. Find Minimum in Rotated Sorted Array 🔗 https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
136. Find Minimum in Rotated Sorted Array II 🔗 https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/
137. Median of Two Sorted Arrays 🔗 https://leetcode.com/problems/median-of-two-sorted-arrays/
138. Kth Largest Element in an Array 🔗 https://leetcode.com/problems/kth-largest-element-in-an-array/
139. Kth Smallest Element in a BST 🔗 https://leetcode.com/problems/kth-smallest-element-in-a-bst/
140. Kth Smallest Element in a Sorted Matrix 🔗 https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/
141. K Closest Points to Origin 🔗 https://leetcode.com/problems/k-closest-points-to-origin/
142. Merge K Sorted Lists 🔗 https://leetcode.com/problems/merge-k-sorted-lists/
143. Smallest Range Covering Elements from K Lists 🔗 https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/
144. Find K Pairs with Smallest Sums 🔗 https://leetcode.com/problems/find-k-pairs-with-smallest-sums/
145. Reorganize String 🔗 https://leetcode.com/problems/reorganize-string/
146. Rearrange String k Distance Apart 🔗 https://leetcode.com/problems/rearrange-string-k-distance-apart/
147. Task Scheduler 🔗 https://leetcode.com/problems/task-scheduler/
148. Hand of Straights 🔗 https://leetcode.com/problems/hand-of-straights/
149. Merge Triplets to Form Target Triplet 🔗 https://leetcode.com/problems/merge-triplets-to-form-target-triplet/
150. Car Pooling 🔗 https://leetcode.com/problems/car-pooling/