This is a collection of coding problems that summarize the grokking the coding interview patterns course on educative.io.
Pattern: Two Pointers
-
https://leetcode.com/problems/remove-duplicates-from-sorted-array/
-
https://leetcode.com/problems/shortest-unsorted-continuous-subarray/
Pattern: Fast & Slow pointers
Pattern: Sliding Window
-
https://leetcode.com/problems/maximum-subarray/ # Close enough
-
https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/
-
https://leetcode.com/problems/longest-substring-without-repeating-characters/
-
https://leetcode.com/problems/longest-repeating-character-replacement/
-
https://leetcode.com/problems/find-all-anagrams-in-a-string/
-
https://leetcode.com/problems/substring-with-concatenation-of-all-words/
Pattern: Merge Intervals
Pattern: Cyclic Sort
-- Cyclic Sort
-- https://leetcode.com/problems/missing-number/
-- https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
-- https://leetcode.com/problems/find-all-duplicates-in-an-array/
-- combine https://leetcode.com/problems/find-the-duplicate-number/ and https://leetcode.com/problems/missing-number/
-- https://leetcode.com/problems/first-missing-positive/
-- https://leetcode.com/problems/kth-missing-positive-number/
Pattern: In-place Reversal of a LinkedList
-- https://leetcode.com/problems/reverse-linked-list/
-- https://leetcode.com/problems/reverse-linked-list-ii/
-- https://leetcode.com/problems/reverse-nodes-in-k-group/
-- https://leetcode.com/problems/rotate-list/
Pattern: Tree Breadth First Search
-- https://leetcode.com/problems/binary-tree-level-order-traversal/
-- https://leetcode.com/problems/binary-tree-level-order-traversal-ii/
-- https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/
-- https://leetcode.com/problems/minimum-depth-of-binary-tree/
-- https://leetcode.com/problems/inorder-successor-in-bst/ # Close, not exact
-- https://leetcode.com/problems/populating-next-right-pointers-in-each-node/ # Close, grokk assumes non-perfect tree
-- https://leetcode.com/problems/binary-tree-right-side-view/
Pattern: Tree Depth First Search
-- https://leetcode.com/problems/path-sum/
-- https://leetcode.com/problems/path-sum-ii/
-- https://leetcode.com/problems/sum-root-to-leaf-numbers/
-- https://leetcode.com/problems/path-sum-iii/
-- https://leetcode.com/problems/diameter-of-binary-tree/
-- https://leetcode.com/problems/binary-tree-maximum-path-sum/
Pattern: Two Heaps
-- https://leetcode.com/problems/find-median-from-data-stream/
-- https://leetcode.com/problems/sliding-window-median/
-- https://leetcode.com/problems/ipo/
-- https://leetcode.com/problems/find-right-interval/
Pattern: Subsets
-- https://leetcode.com/problems/subsets/
-- https://leetcode.com/problems/subsets-ii/
-- https://leetcode.com/problems/permutations/
-- https://leetcode.com/problems/letter-case-permutation/
-- https://leetcode.com/problems/generate-parentheses/
-- https://leetcode.com/problems/generalized-abbreviation/
-- https://leetcode.com/problems/different-ways-to-add-parentheses/
-- https://leetcode.com/problems/unique-binary-search-trees-ii/
-- https://leetcode.com/problems/unique-binary-search-trees/