Concept of coding
Coding of DS & Algo makes very easy with the help of coding pattern
Below are selected problems segregated based on the patterns. This will help you to understand the pattern and know type of problems where this pattern needs to be applied.
Coding Pattern |
Problem |
Level |
Solution |
Warmup |
Sqrt |
Easy |
|
|
Reverse Vowel |
Easy |
|
|
Valid Palindrome |
Easy |
|
|
Valid Anagram |
Easy |
|
|
Shortest Word Distance |
Easy |
|
|
Number of Good Pairs |
Easy |
|
Two Pointers |
Pair with Target Sum |
Easy |
|
|
Remove Duplicates |
Easy |
|
|
Squaring a Sorted Array |
Easy |
|
|
Triplet Sum to Zero |
Easy |
|
|
Triplet Sum Close to Target |
Medium |
|
|
Triplets with smaller sum |
Medium |
|
|
Subarrays with Product Less than a Target |
Medium |
|
|
Dutch National Flag Problem |
Medium |
|
|
Quadruple Sum to Target |
Medium |
|
|
Comparing Strings containing Backspaces |
Easy |
|
|
Minimum Window Sort |
Medium |
|
Island (Matrix Traversal) |
Number of Islands |
Easy |
|
|
Biggest Island |
Easy |
|
|
Flood Fill |
Easy |
|
|
Number of Closed Islands |
Easy |
|
|
Island Perimeter |
Easy |
|
|
Number of distinct Island |
Medium |
MyGit |
|
Detect cycles in Matrix |
Medium |
|
|
|
|
|
Fast and Slow Pointers |
LinkedList Cycle |
Easy |
|
|
Start of LinkedList cycle |
Medium |
|
|
Happy Number |
Medium |
|
|
Middle of the LinkedList |
Easy |
|
|
Palindrome LinkedList |
Medium |
|
|
Rearrange of LinkedList |
Medium |
|
|
Cycle in a Circular Array |
Hard |
|
|
|
|
|
Sliding Window |
Maximum Sum Subarray of Size K |
Easy |
|
|
Smallest Subarray With a Greater Sum |
Easy |
|
|
Longest Substring with K distinct Characters |
Medium |
|
|
Fruits into Baskets |
Medium |
|
|
Longest Substring with same letters after Replacement |
Hard |
|
|
Longest Subarray with Ones after Replacement |
Hard |
|
|
Permutation in a string |
Hard |
|
|
String Anagrams |
Hard |
|
|
Smallest Window containing Substring |
Hard |
|
|
Words Concatenation |
Hard |
|
|
|
|
|
Merge Intervals |
Merge Intervals |
Medium |
|
|
insert Intervals |
Medium |
|
|
Intervals Intersection |
Medium |
|
|
Conflicting Appointments |
Medium |
|
|
Minimum Meeting Rooms |
Medium |
|
|
Maximum CPU Load |
Hard |
|
|
Employee Free Time |
Hard |
|
|
|
|
|
Cyclic Sort |
Cyclic Sort |
Easy |
|
|
Find the missing number |
Easy |
|
|
Find all missing numbers |
Easy |
|
|
Find the duplicate number |
Easy |
|
|
Find all duplicate numbers |
Easy |
|
|
Find the corrupt pair |
Easy |
|
|
Find the smallest missing positive number |
Medium |
|
|
Find the first K missing positive numbers |
Hard |
|
|
|
|
|
In-Place Reversal of a Linked List |
Reverse Linked list |
Easy |
|
|
Reverse a sublist |
Medium |
|
|
Reverse every K-element sub list |
Medium |
|
|
Rotate a linked list |
Medium |
|
|
Reverse alternating K-elements Sub-list |
Medium |
|
|
|
|
|
Monotonic Stack |
Description |
|
|
|
Next Greater Element |
Easy |
|
|
Daily Temperature |
Easy |
|
|
Remove Nodes From Linked List |
Easy |
|
|
Remove All Adjacent Duplicates In String |
Easy |
|
|
Remove All Adjacent Duplicates In String II |
Medium |
|
|
Remove K Digits |
Hard |
|
|
|
|
|
Tree Breadth First Search |
|
|
|
|
Binary Tree level order Traversal |
Easy |
|
|
Binary Tree level order Traversal Reverse |
Easy |
|
|
Zig Zag Traversal |
Medium |
|
|
Level Average in Binary Tree |
Easy |
|
|
Minimum Depth of a Binary Tree |
Easy |
|
|
Level Order Successor |
Easy |
|
|
Connect Level Order Siblings |
Medium |
|
|
Connect All Level Order Siblings |
Medium |
|
|
Right View of Binary Tree |
Easy |
|
Tree Depth First Search |
|
|
|
|
Binary tree Path Sum |
Easy |
|
|
All paths for a sum |
Medium |
|
|
Sum of path Numbers |
Medium |
|
|
Path With Given Sequence |
Medium |
|
|
Counts path for a sum |
Medium |
|
|
Tree Diameter |
Medium |
|
|
Path with maximum Sum |
Medium |
|
Two Heaps Pattern |
|
|
|
|
Find the Median of a Number Stream |
Medium |
|
|
Sliding Window Median |
Hard |
|
|
Maximise Capital |
Hard |
|
|
Next Interval |
Hard |
|
|
|
|
|
Subsets |
Apply BFS approach |
|
|
|
Subsets |
Easy |
|
|
Subsets With Duplicates |
Easy |
|
|
Permutation |
Medium |
|
|
String Permutation by Changing case |
Medium |
|
|
Balanced Parentheses |
Hard |
|
|
Unique Generalised Abbreviations |
Hard |
|
|
Evaluate Expression |
Hard |
|
|
Structurally unique Binary Search Tree |
Hard |
|
|
Count of Structurally Unique Binary Search Tree |
Hard |
|
Modified Binary Search |
|
|
|
|
Order agnostic Binary Search |
Easy |
|
|
Ceiling of a number |
Medium |
|
|
Next Letter |
Medium |
|
|
Number Range |
Medium |
|
|
Search in a Sorted Infinite Array |
Medium |
|
|
Minimum Difference element |
Medium |
|
|
Bitonic Array Maximum |
Easy |
|
|
Search Bitonic Array |
Medium |
|
|
Search in rotated array |
Medium |
|
|
Rotation Count |
Medium |
|
Top K Elements |
|
|
|
|
Top K Numbers |
Easy |
|
|
Kth Smallest Number |
Easy |
|
|
K closest points to the origin |
Easy |
|
|
Connect Ropes |
Easy |
|
|
Top K Frequent Numbers |
Medium |
|
|
Frequency Sort |
Medium |
|
|
Kth Largest number in a stream |
Medium |
|
|
K Closest Numbers |
Medium |
|
|
Maximum Distinct Element |
Medium |
|
|
Sum of elements |
Medium |
|
|
Rearrange String |
Hard |
|
|
Rearrange String K distance apart |
Hard |
|
|
Scheduling Tasks |
Hard |
|
|
Frequency Stack |
Hard |
|
K-Way Merge |
|
|
|
|
Description |
|
|
|
Merge K Sorted Lists |
Medium |
|
|
Kth Smallest Number in M sorted Lists |
Medium |
|
|
Kth Smallest number in a sorted matrix |
Hard |
|
|
Smallest Number range |
Hard |
|
|
K Pair with Largest Sums |
Hard |
|
|
K Pair with smallest sum |
Hard |
|
0/1 Knapsack (DP) |
|
|
|
|
Understanding of DP |
|
|
|
0/1 knapsack |
Medium |
|
|
Equal Subset sum partition |
Medium |
|
|
Subset Sum |
Medium |
|
|
Minimum Subset Sum Difference |
Medium |
|
|
Count of Subset Sum |
Hard |
|
|
Target Sum |
Hard |
|
Unbounded Knapsack (DP) |
|
|
|
|
Rod Cutting |
|
|
|
Coin Change |
|
|
|
Minimum Coin Change |
|
|
|
Maximum Ribbon Cut |
|
|
Fibonacci Numbers (DP) |
|
|
|
|
Fibonacci numbers |
|
|
|
Stair case |
|
|
|
Number Factors |
|
|
|
Minimum Jumps to reach the end |
|
|
|
Minimum Jump with Fee |
|
|
|
House Thief |
|
|
Longest Common Substring (DP) |
|
|
|
|
Longest Common Substring |
|
|
|
Longest Common Subsequence |
|
|
|
Minimum Deletion and Insertion to transform a String into another |
|
|
|
Longest Increasing Subsequence |
|
|
|
Maximum Sum Increasing Subsequence |
|
|
|
Shortest Common Super sequence |
|
|
|
Minimum Deletions to make a sequence sorted |
|
|
|
Longest Repeating Subsequence |
|
|
|
Subseqence pattern matching |
|
|
|
Longest Bitonic Subsequence |
|
|
|
Longest Alternating Subsequence |
|
|
|
Edit Distance |
|
|
|
Strings Interleaving |
|
|
Palindromic Subsequence (DP) |
|
|
|
|
Longest Palindromic Subsequence |
|
|
|
Longest Palindromic substring |
|
|
|
Count of palindromic Subsequence |
|
|
|
Minimum Deletion in a string to make it a Palindrome |
|
|
|
Minimum insertions in a string to make it a palindrome |
|
|
|
Find if a string is K-Palindromic |
|
|
|
Palindromic Partitioning |
|
|
Backtracking |
|
|
|
|
Combination Sum |
Medium |
|
|
Word Search |
Medium |
|
|
Sudoku Solver |
Medium |
|
|
Factor Combinations |
Medium |
|
|
Split a string into Max Number of unique Substrings |
Medium |
|
Topological Sort |
|
|
|
|
Tasks Scheduling |
Medium |
|
|
Tasks Scheduling Order |
Medim |
|
|
All Tasks Scheduling Order |
Hard |
|
|
Alien Dictionary |
Hard |
|
|
Reconstructing a sequence |
Hard |
|
|
Minimum Height Tree |
Hard |
|
|
|
|
|