/LeetcodePatterns

Solutions to the problems mentioned in Leetcode Patterns website - https://seanprashad.com/leetcode-patterns/

Primary LanguageJavaMIT LicenseMIT

LeetcodePatterns

License Language

Solutions to the problems mentioned in Leetcode Patterns website.

Connect with me via

Twitter LinkedIn

Patterns

Array

# Title Solution Difficulty
01 Contains Duplicates Solution Easy
02 Missing Number Solution Easy
03 FindAllNumbersDisappearedInAnArray Solution Easy
04 Single Number Solution Easy
05 Convert 1D Array Into 2D Array Solution Easy
06 Product Of Array Except Self Solution Medium
07 Find The Duplicate Number Solution Medium
08 Find All Duplicates In An Array Solution Medium
09 Set Matrix Zeroes Solution Medium
10 Spiral Matrix Solution Medium
11 Rotate Image Solution Medium
12 Longest Consecutive Sequence Solution Medium
13 First Missing Positive Solution Medium

Breadth First Search (BFS)

# Title Solution Difficulty
01 Average Of Levels In Binary Tree Solution Easy
02 Minimum Depth Of Binary Tree Solution Easy
03 Clone Graph Solution Medium
04 Pacific Atlantic Water Flow Solution Medium
05 Number Of Islands Solution Medium
06 Graph Valid Tree Solution Medium
07 Number Of Connected Components In An Undirected Graph Solution Medium
08 Course Schedule Solution Medium
09 Course Schedule II Solution Medium
10 Minimum Height Trees Solution Medium
11 Binary Tree Level Order Traversal Solution Medium
12 Binary Tree Level Order Traversal II Solution Medium
13 Binary Tree Zigzag Level Order Traversal Solution Medium
14 Populating Next Right Pointers In Each Node Solution Medium
15 Populating Next Right Pointers In Each Node II Solution Medium
16 Binary Tree Right Side View Solution Medium
17 All Nodes Distance K In Binary Tree Solution Medium

Backtracking

# Title Solution Difficulty
01 Word Search Solution Medium
02 Letter Case Permutation Solution Medium
03 Subsets Solution Medium
04 Subsets II Solution Medium
05 Permutations Solution Medium
06 Permutations II Solution Medium
07 Combinations Solution Medium
08 Combination Sum Solution Medium
09 Combination Sum II Solution Medium
10 Combination Sum III Solution Medium
11 Generate Parentheses Solution Medium
12 Palindrome Partitioning Solution Medium
13 Letter Combinations Of A Phone Number Solution Medium
14 Generalized Abbreviation Solution Medium
15 Sudoku Solver Solution Hard
16 N-Queens Solution Hard

Binary Search

# Title Solution Difficulty
01 Binary Search Solution Easy
02 Find Smallest Letter Greater Than Target Solution Easy
03 Find The Duplicate Number Solution Medium
04 Kth Smallest Element In A Sorted Matrix Solution Medium
05 Peak Index In A Mountain Array Solution Medium
06 Find Minimum In A Rotated Sorted Array Solution Medium
07 Find Peak Element Solution Medium
08 Search In Rotated Sorted Array Solution Medium
09 Search In Rotated Sorted Array II Solution Medium
10 Search A 2D Matrix Solution Medium
11 Search A 2D Matrix II Solution Medium
12 Find K Closest Elements Solution Medium
13 Count Of Range Sum Solution Hard
14 Median Of Two Sorted Arrays Solution Hard

Bit Manipulation

# Title Solution Difficulty
1 Missing Number Solution Easy
2 Single Number Solution Easy
3 Counting Bits Solution Easy

Bucket Sort

# Title Solution Difficulty
1 Maximum Frequency Stack Solution Hard

Depth First Search

# Title Solution Difficulty
1 Minimum Depth Of Binary Tree Solution Easy
2 Same Tree Solution Easy
3 Path Sum Solution Easy
4 Maximum Depth Of Binary Tree Solution Easy
5 Diameter Of Binary Tree Solution Easy
6 Merge Two Binary Trees Solution Easy

Design

# Title Solution Difficulty
1 Implement Trie (Prefix Tree) Solution Medium
2 Serialize And Deserialize Binary Tree Solution Hard

Dynamic Programming

# Title Solution Difficulty
1 Climbing Stairs Solution Easy
2 Range Sum Query - Immutable Solution Easy
3 Counting Bits Solution Easy
4 Target Sum Solution Medium
5 House Robber Solution Medium
6 Maximum Subarray Solution Medium
7 House Robber II Solution Medium
8 Coin Change Solution Medium
9 Maximum Product Subarray Solution Medium
10 Longest Increasing Subsequence Solution Medium
11 Longest Palindromic Substring Solution Medium
12 Word Break Solution Medium
13 Combination Sum IV Solution Medium
14 Decode Ways Solution Medium
15 Unique Paths Solution Medium
16 Jump Game Solution Medium
17 Palindromic Substrings Solution Medium
18 Number of Longest Increasing Subsequence Solution Medium
19 Partition Equal Subset Sum Solution Medium
20 Partition To K Equal Sum Subsets Solution Medium
21 Best Time to Buy and Sell Stock With Cooldown Solution Medium