This repository is a structured collection of Leetcode problems, categorized by commonly tested patterns in coding interviews. The goal is to identify patterns in problem-solving, making it easier to approach similar problems during real interviews.
- 📌 Pattern-Based Learning - Focus on fundamental patterns rather than individual problems.
- 🏆 Efficient Practice - Learn how to recognize similar problems quickly.
- ⚡ Optimized Solutions - Solutions are written in Python and optimized for time & space complexity.
- 🏗️ Well-Structured - Problems are grouped into key patterns used in FAANG and top-tier company interviews.
Each pattern has its own directory with a set of solved problems and explanations:
Leetcode-Patterns/
│── Arrays/
│ ├── Two_Pointer.py
│ ├── Sliding_Window.py
│── LinkedList/
│ ├── Reverse_LinkedList.py
│── Trees/
│ ├── Binary_Tree_Traversal.py
│── Graphs/
│ ├── BFS.py
│ ├── DFS.py
│── Dynamic_Programming/
│ ├── Fibonacci.py
│ ├── Longest_Common_Subsequence.py
│── Backtracking/
│ ├── Permutations.py
│── README.md
Each file includes:
- 📝 Problem Statement
- ✅ Optimized Solution
- 📊 Time & Space Complexity Analysis
- 💡 Edge Cases Considered
- Two Pointers (e.g., Sorted Array Sum)
- Sliding Window (e.g., Longest Substring Without Repeating Characters)
- Prefix Sum
- Kadane’s Algorithm (e.g., Maximum Subarray Sum)
- Binary Search
- Reversing a Linked List
- Fast & Slow Pointer
- Cycle Detection
- Merge Two Sorted Lists
- Binary Tree Traversal (DFS, BFS)
- Graph Traversal (DFS, BFS)
- Topological Sorting
- Dijkstra’s Algorithm
- Minimum Spanning Tree
- Fibonacci Sequence
- Knapsack Problem
- Longest Common Subsequence
- Subset Sum
- Coin Change
- Permutations & Combinations
- N-Queens
- Word Search
- Subsets
- Monotonic Stack
- Next Greater Element
- Valid Parentheses
- LRU Cache
git clone https://github.com/Mohit-Jawale/Leetcode-Patterns.git
cd Leetcode-Patterns
python Arrays/Two_Pointer.py
Contributions are welcome! 🚀 If you'd like to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/new-pattern
- Add your changes and commit:
git commit -m "Added a new problem solution for XYZ pattern"
- Push to your branch:
git push origin feature/new-pattern
- Submit a Pull Request (PR) for review.
📧 Email: jawalemohit18@gmail.com
📌 LinkedIn: Mohit Jawale
Happy Coding! 🚀🔥