Top DSA coding patterns | Leetcode questions | Blind Curated 75
2 min readJan 5, 2023
- Sliding Window
- https://leetcode.com/problems/longest-substring-without-repeating-characters/
- https://leetcode.com/problems/minimum-window-substring/
- https://leetcode.com/problems/longest-repeating-character-replacement/
2. Hash maps
- https://leetcode.com/problems/two-sum/
- https://leetcode.com/problems/set-matrix-zeroes/
- https://leetcode.com/problems/contains-duplicate/
3. Dp
- https://leetcode.com/problems/longest-palindromic-substring/
- https://leetcode.com/problems/jump-game/
- https://leetcode.com/problems/unique-paths/
- https://leetcode.com/problems/climbing-stairs/
- https://leetcode.com/problems/decode-ways/
- https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
- https://leetcode.com/problems/word-break/
- https://leetcode.com/problems/maximum-product-subarray/
- https://leetcode.com/problems/house-robber/
- https://leetcode.com/problems/house-robber-ii/
- https://leetcode.com/problems/longest-increasing-subsequence/
- https://leetcode.com/problems/coin-change/
- https://leetcode.com/problems/counting-bits/ ( + Bit manipulation )
- https://leetcode.com/problems/non-overlapping-intervals/
- https://leetcode.com/problems/palindromic-substrings/
4. Two Pointers
- https://leetcode.com/problems/container-with-most-water/
- https://leetcode.com/problems/3sum/
- https://leetcode.com/problems/valid-palindrome/
5. Linked List
- https://leetcode.com/problems/remove-nth-node-from-end-of-list/
- https://leetcode.com/problems/reverse-linked-list/
- https://leetcode.com/problems/linked-list-cycle/
6. Stack
- https://leetcode.com/problems/valid-parentheses/
- https://leetcode.com/problems/reorder-list/ ( Stack + Two pointers)
7. Recursion
8. K-way Merge + Divide & conquer
- https://leetcode.com/problems/merge-k-sorted-lists/
- https://leetcode.com/problems/maximum-subarray/ ( Divide & Conquer + Dp)
- https://leetcode.com/problems/reverse-bits/ (Divide & Conquer)
- https://leetcode.com/problems/number-of-1-bits/
9. Binary search
- https://leetcode.com/problems/search-in-rotated-sorted-array/
- https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
- https://leetcode.com/problems/missing-number/
10. Backtracking
11. Arrays
- https://leetcode.com/problems/rotate-image/
- https://leetcode.com/problems/spiral-matrix/
- https://leetcode.com/problems/insert-interval/
- https://leetcode.com/problems/product-of-array-except-self/ ( arrays+ prefix sum)
- https://leetcode.com/problems/encode-and-decode-strings/ ( +String)
12. Sorting
- https://leetcode.com/problems/group-anagrams/( String+Sorting)
- https://leetcode.com/problems/merge-intervals/
- https://leetcode.com/problems/valid-anagram/
- https://leetcode.com/problems/meeting-rooms/
- https://leetcode.com/problems/meeting-rooms-ii/
13. Tree
- https://leetcode.com/problems/validate-binary-search-tree/
- https://leetcode.com/problems/same-tree/
- https://leetcode.com/problems/binary-tree-level-order-traversal/
- https://leetcode.com/problems/maximum-depth-of-binary-tree/
- https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
- https://leetcode.com/problems/binary-tree-maximum-path-sum/
- https://leetcode.com/problems/invert-binary-tree/
- https://leetcode.com/problems/kth-smallest-element-in-a-bst/
- https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/
- https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
- https://leetcode.com/problems/subtree-of-another-tree/
14. Graph Bfs+Dfs
- https://leetcode.com/problems/clone-graph/
- https://leetcode.com/problems/number-of-islands/ ( + union find)
- https://leetcode.com/problems/graph-valid-tree/ ( + union find)
- https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/
- https://leetcode.com/problems/pacific-atlantic-water-flow/
15. Topological sort
16. Trie
- https://leetcode.com/problems/implement-trie-prefix-tree/
- https://leetcode.com/problems/design-add-and-search-words-data-structure/
- https://leetcode.com/problems/word-search-ii/
17. Heaps
- https://leetcode.com/problems/find-median-from-data-stream/
- https://leetcode.com/problems/top-k-frequent-elements/
18. Bit Manipulation
Reference link: https://leetcode.com/list/xoqag3yj/