/coding-patterns

Implementations and exercises of various coding patterns in C++

Primary LanguageC++

Coding Patterns Implementations and Exercises

Author : Kiran Babu Muddam

Pattern 1 : Sliding Window Pattern

# Title Solution Time Space Difficulty Tag Note
1 Contiguous Subarray Average C++ O(n*K) O(n) Easy
2 Contiguous Subarray Average Optimized C++ O(n) O(n) Easy
3 Contiguous Subarray Maximum Sum C++ O(n*K) O(n) Easy
4 Contiguous Subarray Average Optimized C++ O(n) O(n) Easy
5 Smallest subarray with given sum C++ O(n) O(1) Easy
6 Longest Substring with K Distinct Characters C++ O(n) O(K) Medium Hashmap,c++
7 Fruits into Baskets C++ O(n) O(K) Medium Hashmap,c++
8 No-repeat Substring C++ O(n) O(n) Hard Hashmap,c++
9 Longest Substring with Same Letters after Replacement C++ O(n) O(n) Hard Hashmap,c++
10 Longest Subarray with Ones after Replacement C++ O(n) O(1) Hard Hashmap,c++

Pattern 2: Two Pointers Pattern

# Title Solution Time Space Difficulty Tag Note
11 Two Sum (or) Two Pair with Target Sum Sorted C++ O(n) O(1) Easy
12 Sorted Array remove duplicates inplace C++ O(n) O(1) Easy