Skip to content

Mohit-Jawale/Leetcode-Patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode Patterns 🚀

Master Leetcode with Categorized Problem-Solving Strategies

Leetcode

📌 Overview

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.

🔍 Why This Repository?

  • 📌 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.

📂 Repository Structure

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

📜 Leetcode Patterns Covered

1️⃣ Arrays & Strings

  • 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

2️⃣ Linked List

  • Reversing a Linked List
  • Fast & Slow Pointer
  • Cycle Detection
  • Merge Two Sorted Lists

3️⃣ Trees & Graphs

  • Binary Tree Traversal (DFS, BFS)
  • Graph Traversal (DFS, BFS)
  • Topological Sorting
  • Dijkstra’s Algorithm
  • Minimum Spanning Tree

4️⃣ Dynamic Programming

  • Fibonacci Sequence
  • Knapsack Problem
  • Longest Common Subsequence
  • Subset Sum
  • Coin Change

5️⃣ Recursion & Backtracking

  • Permutations & Combinations
  • N-Queens
  • Word Search
  • Subsets

6️⃣ Stacks & Queues

  • Monotonic Stack
  • Next Greater Element
  • Valid Parentheses
  • LRU Cache

🛠️ Installation & Usage

🔹 Clone the Repository

git clone https://github.com/Mohit-Jawale/Leetcode-Patterns.git
cd Leetcode-Patterns

🔹 Run a Python Script

python Arrays/Two_Pointer.py

🎯 Contribution Guidelines

Contributions are welcome! 🚀 If you'd like to contribute:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature/new-pattern
  3. Add your changes and commit:
    git commit -m "Added a new problem solution for XYZ pattern"
  4. Push to your branch:
    git push origin feature/new-pattern
  5. Submit a Pull Request (PR) for review.

📬 Contact

📧 Email: jawalemohit18@gmail.com
📌 LinkedIn: Mohit Jawale

⭐ If you find this repository useful, don’t forget to give it a star! ⭐

Happy Coding! 🚀🔥

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages