■ DSA Pattern Cheat Sheet (with Data Structures)
1■■ Sliding Window Pattern
Common Data Structures: Arrays, Strings, HashMap
• https://leetcode.com/problems/longest-substring-without-repeating-characters/
• https://leetcode.com/problems/maximum-sum-subarray-of-size-k/
• https://leetcode.com/problems/longest-repeating-character-replacement/
2■■ Two Pointers Pattern
Common Data Structures: Arrays, Linked List, Strings
• https://leetcode.com/problems/container-with-most-water/
• https://leetcode.com/problems/3sum/
• https://leetcode.com/problems/remove-duplicates-from-sorted-array/
3■■ Fast & Slow Pointers Pattern
Common Data Structures: Linked List, Arrays
• https://leetcode.com/problems/linked-list-cycle/
• https://leetcode.com/problems/middle-of-the-linked-list/
• https://leetcode.com/problems/happy-number/
4■■ Merge Intervals Pattern
Common Data Structures: Arrays, Lists, Sorting
• https://leetcode.com/problems/merge-intervals/
• https://leetcode.com/problems/insert-interval/
• https://leetcode.com/problems/meeting-rooms-ii/
5■■ Cyclic Sort Pattern
Common Data Structures: Arrays
• https://leetcode.com/problems/missing-number/
• https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
• https://leetcode.com/problems/find-the-duplicate-number/
6■■ Binary Search Pattern
Common Data Structures: Arrays, Binary Search Tree
• https://leetcode.com/problems/binary-search/
• https://leetcode.com/problems/search-in-rotated-sorted-array/
• https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/
7■■ Top K Elements (Heap) Pattern
Common Data Structures: Heaps, Priority Queue
• https://leetcode.com/problems/top-k-frequent-elements/
• https://leetcode.com/problems/kth-largest-element-in-an-array/
• https://leetcode.com/problems/find-k-closest-elements/
8■■ BFS / DFS (Tree/Graph Traversal) Pattern
Common Data Structures: Trees, Graphs, Queue, Stack
• https://leetcode.com/problems/binary-tree-level-order-traversal/
• https://leetcode.com/problems/number-of-islands/
• https://leetcode.com/problems/clone-graph/
9■■ Backtracking Pattern
Common Data Structures: Recursion, Arrays, Strings
• https://leetcode.com/problems/subsets/
• https://leetcode.com/problems/combination-sum/
• https://leetcode.com/problems/permutations/
■ Dynamic Programming Pattern
Common Data Structures: Arrays, Matrix, HashMap
• https://leetcode.com/problems/climbing-stairs/
• https://leetcode.com/problems/coin-change/
• https://leetcode.com/problems/longest-increasing-subsequence/
■ Extra DSA Sheets
• LeetCode 75 Sheet: https://leetcode.com/studyplan/leetcode-75/
• Blind 75 Sheet:
https://leetcode.com/discuss/general-discussion/460599/blind-75-leetcode-questions
• Striver's SDE Sheet:
https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/
• NeetCode 150 Sheet: https://neetcode.io/practice
• Love Babbar 450 DSA Sheet: https://450dsa.com/