Skip to content

sumitav/leetcode-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Leetcode Patterns Repository

Repository to practice 15 common patterns in Leetcode

Welcome to the Leetcode Patterns Repository! This repository is designed to help you practice solving coding problems using 15 common patterns frequently encountered in Leetcode.

Each pattern represents a specific problem-solving technique or approach that can be applied to a wide range of coding problems. By mastering these patterns, you will become more efficient and confident in solving Leetcode problems.

How to Use This Repository

  1. Clone the repository to your local machine:

    git clone https://github.com/your-username/leetcode-patterns.git
    
  2. Navigate to the repository directory:

    cd leetcode-patterns
    
  3. Inside the repository, you will find a directory for each pattern. Each pattern directory contains multiple coding problems that can be solved using that particular pattern.

  4. Choose a pattern you want to practice and navigate to its directory:

    cd sliding-window-pattern
    
  5. Inside the pattern directory, you will find the coding problems along with their solutions. Open the problem file and read the problem statement.

  6. Implement your solution in the provided code template or create a new file for your solution.

  7. Test your solution using the provided test cases or create your own test cases.

  8. Once you have solved the problem, compare your solution with the provided solution in the solution file.

  9. Repeat steps 4-8 for other patterns or problems you want to practice.

Contributing

If you would like to contribute to this repository by adding new patterns or problems, please follow the contribution guidelines outlined in the CONTRIBUTING.md file.

Resources

To track your progress, click this sheet here.

To-Do List Tracker

Here is a to-do list tracker for the Leetcode problems:

  • Range Sum Query - Immutable - LeetCode (Not started, Easy, Prefix Sum)
  • Contiguous Array - LeetCode (Not started, Medium, Prefix Sum)
  • Subarray Sum Equals K - LeetCode (Not started, Medium, Prefix Sum)
  • Two Sum II - Input Array Is Sorted - LeetCode (Not started, Medium, Two Pointers)
  • 3Sum - LeetCode (Not started, Medium, Two Pointers)
  • Container With Most Water - LeetCode (Not started, Medium, Two Pointers)
  • Maximum Average Subarray I - LeetCode (Not started, Easy, Sliding Window)
  • Longest Substring Without Repeating Characters - LeetCode (Not started, Medium, Sliding Window)
  • Minimum Window Substring - LeetCode (Not started, Hard, Sliding Window)
  • Linked List Cycle - LeetCode (Not started, Easy, Fast & Slow Pointers)
  • Happy Number - LeetCode (Not started, Easy, Fast & Slow Pointers)
  • Find the Duplicate Number - LeetCode (Not started, Medium, Fast & Slow Pointers)
  • Reverse Linked List - LeetCode (Not started, Easy, LinkedList In-place Reversal)
  • Reverse Linked List II - LeetCode (Not started, Medium, LinkedList In-place Reversal)
  • Swap Nodes in Pairs - LeetCode (Not started, Medium, LinkedList In-place Reversal)
  • Next Greater Element I - LeetCode (Not started, Easy, Monotonic Stack)
  • Daily Temperatures - LeetCode (Not started, Medium, Monotonic Stack)
  • Largest Rectangle in Histogram - LeetCode (Not started, Hard, Monotonic Stack)
  • Kth Largest Element in an Array - LeetCode (Not started, Medium, Top ‘K’ Elements)
  • Top K Frequent Elements - LeetCode (Not started, Medium, Top ‘K’ Elements)
  • Find K Pairs with Smallest Sums - LeetCode (Not started, Medium, Top ‘K’ Elements)
  • Merge Intervals - LeetCode (Not started, Medium, Overlapping Intervals)
  • Insert Interval - LeetCode (Not started, Medium, Overlapping Intervals)
  • Non-overlapping Intervals - LeetCode (Not started, Medium, Overlapping Intervals)
  • Search in Rotated Sorted Array - LeetCode (Not started, Medium, "Modified Binary Search")
  • Find Minimum in Rotated Sorted Array - LeetCode (Not started, Medium, "Modified Binary Search")
  • Search a 2D Matrix II - LeetCode (Not started, Medium, "Modified Binary Search")
  • Binary Tree Paths - LeetCode (Not started, Easy, Binary Tree Traversal)
  • Kth Smallest Element in a BST - LeetCode (Not started, Medium, Binary Tree Traversal)
  • Binary Tree Maximum Path Sum - LeetCode (Not started, Hard, Binary Tree Traversal)
  • Clone Graph - LeetCode (Not started, Medium, Depth-First Search (DFS))
  • Path Sum II - LeetCode (Not started, Medium, Depth-First Search (DFS))
  • Course Schedule II - LeetCode (Not started, Medium, Depth-First Search (DFS))
  • Binary Tree Level Order Traversal - LeetCode (Not started, Medium, Breadth-First Search (BFS))
  • Rotting Oranges - LeetCode (Not started, Medium, Breadth-First Search (BFS))
  • Word Ladder - LeetCode (Not started, Hard, Breadth-First Search (BFS))
  • Flood Fill (Not started, Easy, "Matrix Traversal")
  • Number of Islands (Not started, Medium, "Matrix Traversal")
  • Surrounded Regions (Not started, Medium, "Matrix Traversal")
  • Permutations - LeetCode (Not started, Medium, Backtracking)
  • Subsets - LeetCode (Not started, Medium, Backtracking)
  • N-Queens - LeetCode (Not started, Hard, Backtracking)
  • Climbing Stairs - LeetCode (Not started, Easy, Dynamic Programming Patterns)
  • House Robber - LeetCode (Not started, Medium, Dynamic Programming Patterns)
  • Coin Change - LeetCode (Not started, Medium, Dynamic Programming Patterns)
  • Longest Common Subsequence - LeetCode (Not started, Medium, Dynamic Programming Patterns)
  • Longest Increasing Subsequence - LeetCode (Not started, Medium, Dynamic Programming Patterns)
  • Partition Equal Subset Sum - LeetCode (Not started, Medium, Dynamic Programming Patterns)

Remember to update the status as you complete each problem. Happy coding!

About

Repository to practice 15 common patterns in Leetcode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published