Skip to content

This repo contains the codes from the course grokking coding patterns in python and cpp. You can use this to upskill your coding skills.

License

Notifications You must be signed in to change notification settings

Amarnathpg123/grokking_coding_patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grokking-the-Coding-Interview-Patterns-for-Coding-Questions

## 1. Pattern: Sliding Window

    1.  Maximum Sum Subarray of Size K (easy)
    2.  Smallest Subarray with a given sum (easy)
    3.  Longest Substring with K Distinct Characters (medium)
    4.  Fruits into Baskets (medium)
    5.  No-repeat Substring (hard) *
    6.  Longest Substring with Same Letters after Replacement (hard)
    7.  Longest Subarray with Ones after Replacement (hard) *
    8.  Problem Challenge 1 - Permutation in a String (hard) *
    9.  Problem Challenge 2 - String Anagrams (hard)
    10. Problem Challenge 3 - Smallest Window containing Substring (hard) *
    11. Problem Challenge 4 - Words Concatenation (hard) 

## 2. Pattern: Two Pointers

    1. Pair with Target Sum (easy)
    2. Remove Duplicates (easy)
    3. Squaring a Sorted Array (easy)
    4. Triplet Sum to Zero (medium)
    5. Triplet Sum Close to Target (medium)
    6. Triplets with Smaller Sum (medium)
    7. Subarrays with Product Less than a Target (medium) *
    8. Problem Challenge 1 - Quadruple Sum to Target (medium) *
    9. Problem Challenge 2 - Comparing Strings containing Backspaces (medium)
    10. Problem Challenge 3 - Minimum Window Sort (medium) *

## 3. Pattern: Fast & Slow pointers

1. LinkedList Cycle (easy)      
2. Middle of the LinkedList (easy)    
3. Start of LinkedList Cycle (medium) *   
4. Happy Number (medium) *    
5. Problem Challenge 1 - Palindrome LinkedList (medium) *   
6. Problem Challenge 2 - Rearrange a LinkedList (medium)  
7. Problem Challenge 3 - Cycle in a Circular Array (hard) *   

## 4. Pattern: Merge Intervals

1. Merge Intervals (medium)
2. Insert Interval (medium) *
3. Intervals Intersection (medium)
4. Conflicting Appointments (medium)
5. Problem Challenge 1 - Minimum Meeting Rooms (hard) *
6. Problem Challenge 2 - Maximum CPU Load (hard)
7. Problem Challenge 3 - Employee Free Time (hard) *

## 5.Pattern: Cyclic Sort

1. Cyclic Sort (easy)
2. Find the Missing Number (easy)
3. Find all Missing Numbers (easy)
4. Find the Duplicate Number (easy)
5. Find all Duplicate Numbers (easy)
6. Problem Challenge 1 - Find the Corrupt Pair (easy)
7. Problem Challenge 2 - Find the Smallest Missing Positive Number (medium)
8. Problem Challenge 3 - Find the First K Missing Positive Numbers (hard) *

## 6. Pattern: In-place Reversal of a LinkedList

1. Reverse a LinkedList (easy) 
2. Reverse a Sub-list (medium) 
3. Reverse every K-element Sub-list (medium) *
4. Problem Challenge 1 - Reverse alternating K-element Sub-list (medium)
5. Problem Challenge 2 - Rotate a LinkedList (medium)

## 7. Pattern: Tree Breadth First Search

1. Binary Tree Level Order Traversal (easy)
2. Reverse Level Order Traversal (easy) * 
3. Zigzag Traversal (medium)
4. Level Averages in a Binary Tree (easy)
5. Minimum Depth of a Binary Tree (easy) 
6. Level Order Successor (easy)
7. Connect Level Order Siblings (medium)
8. Problem Challenge 1 - Connect All Level Order Siblings (medium)
9. Problem Challenge 2 - Right View of a Binary Tree (easy) 

## 8. Pattern: Tree Depth First Search

1. Binary Tree Path Sum (easy)
2. All Paths for a Sum (medium) *
3. Sum of Path Numbers (medium)
4. Path With Given Sequence (medium) *
5. Count Paths for a Sum (medium)
6. Problem Challenge 1 - Tree Diameter (medium) *
7. Problem Challenge 2 - Path with Maximum Sum (hard) *

## 9. Pattern: Two Heaps

1. Find the Median of a Number Stream (medium) 
2. Sliding Window Median (hard) *
3. Maximize Capital (hard) * 
4. Problem Challenge 1 - Next Interval (hard) 

## 10. Pattern: Subsets

1. Subsets (easy)
2. Subsets With Duplicates (easy) *
3. Permutations (medium) *
4. String Permutations by changing case (medium)
5. Balanced Parentheses (hard) *
6. Unique Generalized Abbreviations (hard) * 
7. Problem Challenge 1 - Evaluate Expression (hard) *
8. Problem Challenge 2 - Structurally Unique Binary Search Trees (hard) *
9. Problem Challenge 3 - Count of Structurally Unique Binary Search Trees (hard)

## 11. Pattern: Modified Binary Search

1. Order-agnostic Binary Search (easy)
2. Ceiling of a Number (medium) *
3. Next Letter (medium)
4. Number Range (medium) *
5. Search in a Sorted Infinite Array (medium) *
6. Minimum Difference Element (medium)
7. Bitonic Array Maximum (easy)
8. Problem Challenge 1 - Search Bitonic Array (medium)
9. Problem Challenge 2 - Search in Rotated Array (medium) * 
10. Problem Challenge 3 - Rotation Count (medium) *

## 12. Pattern: Bitwise XOR

1. Single Number (easy)
2. Two Single Numbers (medium) *
3. Complement of Base 10 Number (medium)
4. Problem Challenge 1

## 13. Pattern Top 'K' Elements

1. Top 'K' Numbers (easy)
2. Kth Smallest Number (easy)
3. 'K' Closest Points to the Origin (easy)
4. Connect Ropes (easy) *
5. Top 'K' Frequent Numbers (medium)
6. Frequency Sort (medium) *
7. Kth Largest Number in a Stream (medium)
8. 'K' Closest Numbers (medium)
9. Maximum Distinct Elements (medium)
10. Sum of Elements (medium) 
11. Rearrange String (hard)
12. Problem Challenge 1 - Rearrange String K Distance Apart (hard) 
13. Problem Challenge 2 - Scheduling Tasks (hard) *
14. Problem Challenge 3 - Frequency Stack (hard) 

## 14. Pattern: K-way merge

1. Merge K Sorted Lists (medium) *
2. Kth Smallest Number in M Sorted Lists (Medium) 
3. Kth Smallest Number in a Sorted Matrix (Hard) *
4. Smallest Number Range (Hard) *
5. Problem Challenge 1 - K Pairs with Largest Sums (Hard) 

## 15. Pattern : 0/1 Knapsack (Dynamic Programming)

1. 0/1 Knapsack (medium)
2. Equal Subset Sum Partition (medium) *
3. Subset Sum (medium)
4. Minimum Subset Sum Difference (hard) *
5. Problem Challenge 1 - Count of Subset Sum (hard) 
6. Problem Challenge 2 - Target Sum (hard) 

## 16. Pattern: Topological Sort (Graph)

1. Topological Sort (medium) *
2. Tasks Scheduling (medium)
3. Tasks Scheduling Order (medium)
4. All Tasks Scheduling Orders (hard) *
5. Alien Dictionary (hard) 
6. Problem Challenge 1 - Reconstructing a Sequence (hard) *
7. Problem Challenge 2 - Minimum Height Trees (hard) *

## 17. Miscellaneous

1. Kth Smallest Number (hard) *

About

This repo contains the codes from the course grokking coding patterns in python and cpp. You can use this to upskill your coding skills.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published