A comprehensive collection of solutions for the LeetCode 75 study plan, covering fundamental algorithms and data structures essential for technical interviews.
This repository contains 75 carefully selected LeetCode problems that cover the most important concepts in algorithms and data structures.
| Category | Count | Problems |
|---|---|---|
| Array/String | 20 | Two pointers, sliding window, prefix sum |
| Two Pointers | 8 | Array manipulation, collision detection |
| Sliding Window | 7 | Fixed/variable window techniques |
| Stack | 5 | Monotonic stack, parentheses matching |
| Binary Tree | 12 | DFS, BFS, tree traversals |
| Binary Search Tree | 3 | Search, insertion, deletion |
| Graph | 5 | DFS, BFS, shortest path |
| Heap/Priority Queue | 3 | K-largest elements, scheduling |
| Backtracking | 3 | Combinations, permutations |
| Dynamic Programming | 12 | 1D/2D DP, state transitions |
| Greedy | 3 | Optimal choices at each step |
| Bit Manipulation | 3 | XOR, bit masking |
| Trie | 2 | Prefix matching, autocomplete |
| Intervals | 2 | Merging, scheduling |
leetcode75/
βββ 01-25/ # Easy problems
βββ 26-50/ # Medium problems
βββ 51-75/ # Hard problems
βββ README.md
- Python 3.6+
- No external dependencies required
# Clone the repository
git clone https://github.com/sachin-kumar-2003/leetcode75.git
cd leetcode75- Two Pointers: Use two indices moving towards/away from each other
- Sliding Window: Maintain a window of elements with left/right pointers
- Prefix Sum: Pre-calculate cumulative sums for range queries
- DFS: Depth-first traversal (preorder, inorder, postorder)
- BFS: Level-order traversal using queue
- Recursion: Natural fit for tree problems
- 1D DP: Single dimension state
- 2D DP: Two dimensions state (strings, grids)
- State transitions: Build solution from smaller subproblems
- Avoid nested loops when possible
- Use hash maps for O(1) lookups
- Pre-calculate values that are used multiple times
- In-place modifications to reduce extra space
- Re-use data structures instead of creating new ones
- Bit manipulation for compact storage
Start with easy problems to build fundamentals:
- Array manipulation techniques
- Two pointer patterns
- Basic data structures (stack, queue)
Progress to medium problems:
- Linked list operations
- Tree traversals and operations
- Graph algorithms (DFS, BFS)
Master complex algorithms:
- Dynamic programming patterns
- Backtracking techniques
- Advanced data structures (trie, heap)