Skip to content

regulapati-n/Practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 

Repository files navigation

Practice

๐Ÿ“˜ The Complete LeetCode Fundamentals Guide

Welcome to the comprehensive guide to mastering core computer science fundamentals and recognizing problem-solving patterns for technical interviews.

This repository contains a curated, categorized list of essential LeetCode problems, along with a structured 8-week study plan designed to build your skills progressively.


๐Ÿš€ How to Use This Guide

  1. Follow the Study Plan: Start with Phase 1 and work your way down. Do not skip ahead until you are comfortable with the core concepts of your current phase.
  2. Time Box Your Practice: Limit yourself to 20 minutes for Easy problems and 40 minutes for Mediums.
  3. Understand, Don't Memorize: If you are stuck after the time limit, read the solution, understand the pattern, and try coding it again from scratch.
  4. Use Your Interview Language: Implement all solutions in the language you intend to use in interviews (e.g., C#, Python, Java) to build strict muscle memory.

๐Ÿ—“๏ธ The 8-Week Study Plan

Phase 1: The Bedrock (Weeks 1-2)

Focus on how data is stored continuously in memory and how to manipulate indices efficiently.

  • Concepts to Master: Time & Space Complexity (Big-O), Two Pointers, Sliding Window, Prefix Sums.
  • Core Problem Set:
    • Arrays: Two Sum (#1), Remove Duplicates from Sorted Array (#26), Best Time to Buy and Sell Stock (#121).
    • Strings: Valid Palindrome (#125), Longest Substring Without Repeating Characters (#3).
    • Patterns: Container With Most Water (#11).

Phase 2: Memory & References (Weeks 3-4)

Transition from contiguous memory to node-based data structures.

  • Concepts to Master: Singly vs. Doubly Linked Lists, LIFO (Stacks), FIFO (Queues), Hash Maps.
  • Core Problem Set:
    • Linked Lists: Reverse Linked List (#206), Merge Two Sorted Lists (#21), Linked List Cycle (#141).
    • Stacks/Queues: Valid Parentheses (#20), Min Stack (#155).
    • Hashing: Group Anagrams (#49), Longest Consecutive Sequence (#128).

Phase 3: Non-Linear Hierarchies (Weeks 5-6)

Mastering recursive thinking and traversal algorithms.

  • Concepts to Master: Binary Trees, Binary Search Trees (BST), Depth-First Search (DFS), Breadth-First Search (BFS), Recursion.
  • Core Problem Set:
    • Trees: Binary Tree Level Order Traversal (#102), Maximum Depth of Binary Tree (Foundational).
    • BST: Validate Binary Search Tree (#98), Lowest Common Ancestor (#236).

Phase 4: Connections, State, & Data Retrieval (Weeks 7-8)

Tackling complex networks, pathfinding, and robust data querying.

  • Concepts to Master: Graph representations, Dynamic Programming (Memoization vs. Tabulation), Relational Database logic (Joins, Aggregations).
  • Core Problem Set:
    • Graphs: Number of Islands (#200), Clone Graph (#133), Course Schedule (#207).
    • DP: Climbing Stairs (#70), Coin Change (#322), Longest Increasing Subsequence (#300).
    • SQL: Combine Two Tables (#175), Second Highest Salary (#176).

๐Ÿ—‚๏ธ The Complete Problem Bank by Data Structure

๐Ÿงฑ Arrays, Matrices & Dynamic Programming

ID Problem Title Difficulty
1 Two Sum Easy
4 Median of Two Sorted Arrays Hard
11 Container With Most Water Medium
15 3Sum Medium
16 3Sum Closest Medium
18 4Sum Medium
26 Remove Duplicates from Sorted Array Easy
27 Remove Element Easy
31 Next Permutation Medium
32 Longest Valid Parentheses Hard
33 Search in Rotated Sorted Array Medium
34 Find First and Last Position of Element in Sorted Array Medium
35 Search Insert Position Easy
39 Combination Sum Medium
40 Combination Sum II Medium
41 First Missing Positive Hard
42 Trapping Rain Water Hard
45 Jump Game II Medium
46 Permutations Medium
47 Permutations II Medium
48 Rotate Image Medium
51 N-Queens Hard
53 Maximum Subarray Medium
54 Spiral Matrix Medium
55 Jump Game Medium
56 Merge Intervals Medium
57 Insert Interval Medium
60 Permutation Sequence Hard
62 Unique Paths Medium
70 Climbing Stairs Easy
72 Edit Distance Medium
73 Set Matrix Zeroes Medium
74 Search a 2D Matrix Medium
75 Sort Colors Medium
78 Subsets Medium
80 Remove Duplicates from Sorted Array II Medium
84 Largest Rectangle in Histogram Hard
85 Maximal Rectangle Hard
88 Merge Sorted Array Easy
90 Subsets II Medium
115 Distinct Subsequences Hard
118 Pascal's Triangle Easy
119 Pascal's Triangle II Easy
121 Best Time to Buy and Sell Stock Easy
122 Best Time to Buy and Sell Stock II Medium
123 Best Time to Buy and Sell Stock III Hard
128 Longest Consecutive Sequence Medium
131 Palindrome Partitioning Medium
134 Gas Station Medium
135 Candy Hard
152 Maximum Product Subarray Medium
153 Find Minimum in Rotated Sorted Array Medium
162 Find Peak Element Medium
167 Two Sum II - Input Array Is Sorted Medium
169 Majority Element Easy
179 Largest Number Medium
189 Rotate Array Medium
198 House Robber Medium
209 Minimum Size Subarray Sum Medium
213 House Robber II Medium
215 Kth Largest Element in an Array Medium
216 Combination Sum III Medium
217 Contains Duplicate Easy
219 Contains Duplicate II Easy
220 Contains Duplicate III Hard
221 Maximal Square Medium
223 Rectangle Area Medium
228 Summary Ranges Easy
229 Majority Element II Medium
238 Product of Array Except Self Medium
239 Sliding Window Maximum Hard
242 Valid Anagram Easy
253 Meeting Rooms II Medium
271 Encode and Decode Strings Medium
278 First Bad Version Easy
279 Perfect Squares Medium
283 Move Zeroes Easy
287 Find the Duplicate Number Medium
300 Longest Increasing Subsequence Medium
303 Range Sum Query - Immutable Easy
304 Range Sum Query 2D - Immutable Medium
312 Burst Balloons Hard
315 Count of Smaller Numbers After Self Hard
322 Coin Change Medium
349 Intersection of Two Arrays Easy
350 Intersection of Two Arrays II Easy
354 Russian Doll Envelopes Hard
360 Sort Transformed Array Medium
407 Trapping Rain Water II Hard
410 Split Array Largest Sum Hard
413 Arithmetic Slices Medium
414 Third Maximum Number Easy
435 Non-overlapping Intervals Medium
442 Find All Duplicates in an Array Medium
448 Find All Numbers Disappeared in an Array Easy
455 Assign Cookies Easy
480 Sliding Window Median Hard
485 Max Consecutive Ones Easy
498 Diagonal Traverse Medium
509 Fibonacci Number Easy
518 Coin Change II Medium
525 Contiguous Array Medium
540 Single Element in a Sorted Array Medium
560 Subarray Sum Equals K Medium
605 Can Place Flowers Easy
643 Maximum Average Subarray I Easy
658 Find K Closest Elements Medium
698 Partition to K Equal Sum Subsets Medium
704 Binary Search Easy
714 Best Time to Buy and Sell Stock with Transaction Fee Medium
766 Toeplitz Matrix Easy
799 Champagne Tower Medium
840 Magic Squares In Grid Medium
852 Peak Index in a Mountain Array Medium
871 Minimum Number of Refueling Stops Hard
875 Koko Eating Bananas Medium
896 Monotonic Array Easy
904 Fruit Into Baskets Medium
905 Sort Array By Parity Easy
907 Sum of Subarray Minimums Medium
912 Sort an Array Medium
914 X of a Kind in a Deck of Cards Easy
922 Sort Array By Parity II Easy
930 Binary Subarrays With Sum Medium
939 Minimum Area Rectangle Medium
956 Tallest Billboard Hard
961 N-Repeated Element in Size 2N Array Easy
974 Subarray Sums Divisible by K Medium
977 Squares of a Sorted Array Easy
978 Longest Turbulent Subarray Medium
992 Subarrays with K Different Integers Hard
1004 Max Consecutive Ones III Medium
1011 Capacity To Ship Packages Within D Days Medium
1027 Longest Arithmetic Subsequence Medium
1095 Find in Mountain Array Hard
1128 Number of Equivalent Domino Pairs Easy
1200 Minimum Absolute Difference Easy
1262 Greatest Sum Divisible by Three Medium
1266 Minimum Time Visiting All Points Easy
1277 Count Square Submatrices with All Ones Medium
1283 Find the Smallest Divisor Given a Threshold Medium
1292 Maximum Side Length of a Square with Sum Less than or Equal to Threshold Medium
1296 Divide Array in Sets of K Consecutive Numbers Medium
1351 Count Negative Numbers in a Sorted Matrix Easy
1458 Max Dot Product of Two Subsequences Hard
1470 Shuffle the Array Easy
1480 Running Sum of 1d Array Easy
1482 Minimum Number of Days to Make m Bouquets Medium
1502 Can Make Arithmetic Progression From Sequence Easy
1512 Number of Good Pairs Easy
1539 Kth Missing Positive Number Easy
1752 Check if Array Is Sorted and Rotated Easy
1838 Frequency of the Most Frequent Element Medium
1877 Minimize Maximum Pair Sum in Array Medium
1895 Largest Magic Square Medium
1925 Count Square Sum Triples Easy
1929 Concatenation of Array Easy
1975 Maximum Matrix Sum Medium
1984 Minimum Difference Between Highest and Lowest of K Scores Easy
2035 Partition Array Into Two Arrays to Minimize Sum Difference Hard
2054 Two Best Non-Overlapping Events Medium
2110 Number of Smooth Descent Periods of a Stock Medium
2149 Rearrange Array Elements by Sign Medium
2188 Minimum Time to Finish the Race Hard
2402 Meeting Rooms III Hard
2535 Difference Between Element Sum and Digit Sum of an Array Easy
2654 Minimum Number of Operations to Make All Array Elements Equal to 1 Medium
2812 Find the Safest Path in a Grid Medium
2943 Maximize Area of Square Hole in Grid Medium
2965 Find Missing and Repeated Values Easy
2974 Minimum Number Game Easy
2975 Maximum Square Area by Removing Fences From a Field Medium
3010 Divide an Array Into Subarrays With Minimum Cost I Easy
3047 Find the Largest Area of Square Inside Two Rectangles Medium
3314 Construct the Minimum Bitwise Array I Easy
3379 Transformed Array Easy
3380 Maximum Area Rectangle With Point Constraints I Medium
3381 Maximum Subarray Sum With Length Divisible by K Medium
3453 Separate Squares I Medium
3454 Separate Squares II Hard
3507 Minimum Pair Removal to Sort Array I Easy
3512 Minimum Operations to Make Array Sum Divisible by K Easy
3531 Count Covered Buildings Medium
3562 Maximum Profit from Trading Stocks with Discounts Hard
3573 Best Time to Buy and Sell Stock V Medium
3577 Count the Number of Computer Unlocking Permutations Medium
3583 Count Special Triplets Medium
3623 Count Number of Trapezoids I Medium
3625 Count Number of Trapezoids II Hard
3634 Minimum Removals to Balance Array Medium
3637 Trionic Array I Easy
3640 Trionic Array II Hard
3713 Longest Balanced Substring I Medium
3714 Longest Balanced Substring II Medium
3719 Longest Balanced Subarray I Medium
3721 Longest Balanced Subarray II Hard
3731 Find Missing Elements Easy
3738 Longest Non-Decreasing Subarray After Replacing at Most One Element Medium
3751 Total Waviness of Numbers in Range I Medium
3756 Concatenate Non-Zero Digits and Multiply by Sum II Medium

๐Ÿงต Strings

ID Problem Title Difficulty
3 Longest Substring Without Repeating Characters Medium
5 Longest Palindromic Substring Medium
6 Zigzag Conversion Medium
10 Regular Expression Matching Hard
14 Longest Common Prefix Easy
17 Letter Combinations of a Phone Number Medium
20 Valid Parentheses Easy
22 Generate Parentheses Medium
28 Find the Index of the First Occurrence in a String Easy
38 Count and Say Medium
43 Multiply Strings Medium
44 Wildcard Matching Hard
49 Group Anagrams Medium
58 Length of Last Word Easy
68 Text Justification Hard
71 Simplify Path Medium
76 Minimum Window Substring Hard
97 Interleaving String Medium
125 Valid Palindrome Easy
139 Word Break Medium
140 Word Break II Hard
151 Reverse Words in a String Medium
205 Isomorphic Strings Easy
249 Group Shifted Strings Medium
344 Reverse String Easy
345 Reverse Vowels of a String Easy
383 Ransom Note Easy
387 First Unique Character in a String Easy
392 Is Subsequence Easy
394 Decode String Medium
395 Longest Substring with At Least K Repeating Characters Medium
409 Longest Palindrome Easy
415 Add Strings Easy
424 Longest Repeating Character Replacement Medium
438 Find All Anagrams in a String Medium
443 String Compression Medium
520 Detect Capital Easy
541 Reverse String II Easy
567 Permutation in String Medium
678 Valid Parenthesis String Medium
692 Top K Frequent Words Medium
696 Count Binary Substrings Easy
767 Reorganize String Medium
777 Swap Adjacent in LR String Medium
796 Rotate String Easy
833 Find And Replace in String Medium
844 Backspace String Compare Easy
1021 Remove Outermost Parentheses Easy
1044 Longest Duplicate Substring Hard
1047 Remove All Adjacent Duplicates In String Easy
1071 Greatest Common Divisor of Strings Easy
1143 Longest Common Subsequence Medium
1358 Number of Substrings Containing All Three Characters Medium
1528 Shuffle String Easy
1653 Minimum Deletions to Make String Balanced Medium
1657 Determine if Two Strings Are Close Medium
1768 Merge Strings Alternately Easy
1859 Sorting the Sentence Easy
2337 Move Pieces to Obtain a String Medium
2423 Remove Letter To Equalize Frequency Easy
2976 Minimum Cost to Convert String I Medium

๐Ÿ”— Linked Lists

ID Problem Title Difficulty
2 Add Two Numbers Medium
19 Remove Nth Node From End of List Medium
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
83 Remove Duplicates from Sorted List Easy
86 Partition List Medium
92 Reverse Linked List II Medium
138 Copy List with Random Pointer Medium
141 Linked List Cycle Easy
142 Linked List Cycle II Medium
143 Reorder List Medium
148 Sort List Medium
160 Intersection of Two Linked Lists Easy
206 Reverse Linked List Easy
234 Palindrome Linked List Easy
237 Delete Node in a Linked List Medium
430 Flatten a Multilevel Doubly Linked List Medium
876 Middle of the Linked List Easy

๐ŸŒณ Trees & Tries

ID Problem Title Difficulty
94 Binary Tree Inorder Traversal Easy
95 Unique Binary Search Trees II Medium
98 Validate Binary Search Tree Medium
99 Recover Binary Search Tree Medium
100 Same Tree Easy
102 Binary Tree Level Order Traversal Medium
103 Binary Tree Zigzag Level Order Traversal Medium
108 Convert Sorted Array to Binary Search Tree Easy
110 Balanced Binary Tree Easy
112 Path Sum Easy
113 Path Sum II Medium
116 Populating Next Right Pointers in Each Node Medium
124 Binary Tree Maximum Path Sum Hard
230 Kth Smallest Element in a BST Medium
236 Lowest Common Ancestor of a Binary Tree Medium
297 Serialize and Deserialize Binary Tree Hard
337 House Robber III Medium
437 Path Sum III Medium
450 Delete Node in a BST Medium
543 Diameter of Binary Tree Easy
572 Subtree of Another Tree Easy
653 Two Sum IV - Input is a BST Easy
669 Trim a Binary Search Tree Medium
701 Insert into a Binary Search Tree Medium
865 Smallest Subtree with all the Deepest Nodes Medium
987 Vertical Order Traversal of a Binary Tree Hard
1008 Construct Binary Search Tree from Preorder Traversal Medium
1161 Maximum Level Sum of a Binary Tree Medium
1339 Maximum Product of Splitted Binary Tree Medium
1373 Maximum Sum BST in Binary Tree Hard
1483 Kth Ancestor of a Tree Node Hard

๐ŸŒ Graphs & Search (BFS/DFS)

ID Problem Title Difficulty
37 Sudoku Solver Hard
79 Word Search Medium
126 Word Ladder II Hard
127 Word Ladder Hard
130 Surrounded Regions Medium
133 Clone Graph Medium
200 Number of Islands Medium
207 Course Schedule Medium
210 Course Schedule II Medium
399 Evaluate Division Medium
417 Pacific Atlantic Water Flow Medium
695 Max Area of Island Medium
721 Accounts Merge Medium
733 Flood Fill Easy
743 Network Delay Time Medium
787 Cheapest Flights Within K Stops Medium
802 Find Eventual Safe States Medium
815 Bus Routes Hard
827 Making A Large Island Hard
843 Guess the Word Hard
909 Snakes and Ladders Medium
934 Shortest Bridge Medium
947 Most Stones Removed with Same Row or Column Medium
980 Unique Paths III Hard
994 Rotting Oranges Medium
1631 Path With Minimum Effort Medium
1971 Find if Path Exists in Graph Easy
1976 Number of Ways to Arrive at Destination Medium

๐Ÿงฎ Stacks, Queues, Heaps & System Design

ID Problem Title Difficulty
146 LRU Cache Medium
150 Evaluate Reverse Polish Notation Medium
155 Min Stack Medium
224 Basic Calculator Hard
227 Basic Calculator II Medium
232 Implement Queue using Stacks Easy
295 Find Median from Data Stream Hard
347 Top K Frequent Elements Medium
359 Logger Rate Limiter Easy
362 Design Hit Counter Medium
380 Insert Delete GetRandom O(1) Medium
402 Remove K Digits Medium
496 Next Greater Element I Easy
503 Next Greater Element II Medium
622 Design Circular Queue Medium
636 Exclusive Time of Functions Medium
703 Kth Largest Element in a Stream Easy
715 Range Module Hard
735 Asteroid Collision Medium
900 RLE Iterator Medium
981 Time Based Key-Value Store Medium
1244 Design A Leaderboard Medium
1381 Design a Stack With Increment Operation Medium
1603 Design Parking System Easy
2296 Design a Text Editor Hard
3815 Design Auction System Medium

๐Ÿงฎ Mathematics & Bit Manipulation

ID Problem Title Difficulty
7 Reverse Integer Medium
9 Palindrome Number Easy
12 Integer to Roman Medium
13 Roman to Integer Easy
29 Divide Two Integers Medium
50 Pow(x, n) Medium
66 Plus One Easy
67 Add Binary Easy
69 Sqrt(x) Easy
136 Single Number Easy
137 Single Number II Medium
168 Excel Sheet Column Title Easy
190 Reverse Bits Easy
202 Happy Number Easy
231 Power of Two Easy
233 Number of Digit One Hard
258 Add Digits Easy
263 Ugly Number Easy
268 Missing Number Easy
282 Expression Add Operators Hard
292 Nim Game Easy
371 Sum of Two Integers Medium
401 Binary Watch Easy
507 Perfect Number Easy
645 Set Mismatch Easy
693 Binary Number with Alternating Bits Easy
728 Self Dividing Numbers Easy
1015 Smallest Integer Divisible by K Medium
1025 Divisor Game Easy
1137 N-th Tribonacci Number Easy
1523 Count Odd Numbers in an Interval Range Easy
1922 Count Good Numbers Medium
2235 Add Two Integers Easy
2396 Strictly Palindromic Number Medium

๐Ÿ—„๏ธ Databases (SQL) & JavaScript Fundamentals

ID Problem Title Difficulty
175 Combine Two Tables Easy
176 Second Highest Salary Medium
177 Nth Highest Salary Medium
178 Rank Scores Medium
181 Employees Earning More Than Their Managers Easy
183 Customers Who Never Order Easy
196 Delete Duplicate Emails Easy
197 Rising Temperature Easy
262 Trips and Users Hard
550 Game Play Analysis IV Medium
577 Employee Bonus Easy
585 Investments in 2016 Medium
586 Customer Placing the Largest Number of Orders Easy
595 Big Countries Easy
601 Human Traffic of Stadium Hard
620 Not Boring Movies Easy
1068 Product Sales Analysis I Easy
1141 User Activity for the Past 30 Days I Easy
1148 Article Views I Easy
1193 Monthly Transactions I Medium
1251 Average Selling Price Easy
1378 Replace Employee ID With The Unique Identifier Easy
1661 Average Time of Process per Machine Easy
1683 Invalid Tweets Easy
1757 Recyclable and Low Fat Products Easy
1934 Confirmation Rate Medium
2619 Array Prototype Last Easy
2620 Counter Easy
2667 Create Hello World Function Easy
2704 To Be Or Not To Be Easy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors