DSA Sheet
DSA Sheet
v=ljq3T9vGA6c
Arrays
● https://leetcode.com/problems/two-sum/
● https://leetcode.com/problems/3sum/
● https://leetcode.com/problems/contains-duplicate
● https://leetcode.com/problems/merge-intervals/
● https://leetcode.com/problems/kth-largest-element-in-an-
array/
● https://leetcode.com/problems/maximum-subarray/
● https://leetcode.com/problems/maximum-product-subarray/
● https://leetcode.com/problems/best-time-to-buy-and-sell-
stock
● https://leetcode.com/problems/container-with-most-water/
● https://leetcode.com/problems/trapping-rain-water/
● https://leetcode.com/problems/subarray-sum-equals-k
● https://leetcode.com/problems/minimum-size-subarray-sum/
● https://leetcode.com/problems/median-of-two-sorted-arrays
● https://leetcode.com/problems/sort-colors/
● https://leetcode.com/problems/majority-element/
● https://leetcode.com/problems/longest-consecutive-
sequence
● https://leetcode.com/problems/longest-substring-without-
repeating-characters
● https://leetcode.com/problems/minimum-window-substring
● https://leetcode.com/problems/permutation-in-string/
2D Arrays
● https://leetcode.com/problems/search-a-2d-matrix/
● https://leetcode.com/problems/rotate-image/
● https://leetcode.com/problems/set-matrix-zeroes/
● https://leetcode.com/problems/valid-sudoku
Stack and Queues
● https://leetcode.com/problems/implement-queue-using-
stacks
● https://leetcode.com/problems/implement-stack-using-
queues
● https://leetcode.com/problems/valid-parentheses
● https://leetcode.com/problems/daily-temperatures/
● https://leetcode.com/problems/implement-queue-using-
stacks
● https://leetcode.com/problems/longest-valid-parentheses
● https://leetcode.com/problems/largest-rectangle-in-
histogram
● https://leetcode.com/problems/maximal-rectangle
● https://leetcode.com/problems/min-stack/
● https://leetcode.com/problems/trapping-rain-water
● https://leetcode.com/problems/remove-k-digits
● https://leetcode.com/problems/sliding-window-maximum/
String
● https://leetcode.com/problems/longest-palindromic-
substring/
● https://leetcode.com/problems/longest-substring-without-
repeating-characters/
● https://leetcode.com/problems/longest-common-prefix/
● https://leetcode.com/problems/minimum-window-substring/
● https://leetcode.com/problems/valid-anagram/
● https://leetcode.com/problems/regular-expression-matching/
● https://leetcode.com/problems/largest-number/
Greedy
● https://leetcode.com/problems/minimum-number-of-arrows-
to-burst-balloons
● https://leetcode.com/problems/best-time-to-buy-and-sell-
stock-ii/
● https://leetcode.com/problems/jump-game-ii/
● https://leetcode.com/problems/candy/
Recursion and Backtracking
● https://leetcode.com/problems/combination-sum/
● https://leetcode.com/problems/combination-sum-ii/
● https://leetcode.com/problems/letter-combinations-of-a-
phone-number/
● https://leetcode.com/problems/generate-parentheses/
● https://leetcode.com/problems/sudoku-solver
● https://leetcode.com/problems/permutations/
● https://leetcode.com/problems/permutations-ii/
● https://leetcode.com/problems/n-queens/
● https://leetcode.com/problems/n-queens-ii/
● https://leetcode.com/problems/subsets
● https://leetcode.com/problems/next-permutation
● https://leetcode.com/problems/permutation-sequence/
● https://leetcode.com/problems/combinations/
Linked List
● https://leetcode.com/problems/reverse-linked-list (Both
Iterative / Recursive)
● https://leetcode.com/problems/reverse-nodes-in-k-group
● https://leetcode.com/problems/linked-list-cycle/
● https://leetcode.com/problems/merge-two-sorted-lists
● https://leetcode.com/problems/merge-k-sorted-lists
● https://leetcode.com/problems/linked-list-cycle/
● https://leetcode.com/problems/middle-of-the-linked-list
● https://leetcode.com/problems/delete-the-middle-node-of-a-
linked-list
● https://leetcode.com/problems/intersection-of-two-linked-
lists/
● https://leetcode.com/problems/sort-list/
● https://leetcode.com/problems/copy-list-with-random-
pointer/
● https://leetcode.com/problems/lru-cache
Heap
● https://leetcode.com/problems/kth-largest-element-in-an-
array
● https://leetcode.com/problems/find-median-from-data-
stream
● https://leetcode.com/problems/top-k-frequent-elements
● https://leetcode.com/problems/top-k-frequent-words
● https://leetcode.com/problems/k-closest-points-to-origin/
Binary Trees
● https://leetcode.com/problems/binary-tree-inorder-traversal/
● https://leetcode.com/problems/binary-tree-level-order-
traversal/
● https://leetcode.com/problems/diameter-of-binary-tree
● https://leetcode.com/problems/maximum-depth-of-binary-
tree
● https://leetcode.com/problems/invert-binary-tree/
● https://leetcode.com/problems/same-tree/
● https://leetcode.com/problems/binary-tree-right-side-view/
● https://leetcode.com/problems/construct-binary-tree-from-
preorder-and-inorder-traversal/
● https://leetcode.com/problems/flatten-binary-tree-to-linked-
list/
● https://leetcode.com/problems/path-sum-iii/
● https://leetcode.com/problems/lowest-common-ancestor-of-
a-binary-tree/
● https://leetcode.com/problems/all-nodes-distance-k-in-
binary-tree/
● https://leetcode.com/problems/serialize-and-deserialize-
binary-tree
Binary Search Trees
● https://leetcode.com/problems/delete-node-in-a-bst/
● https://leetcode.com/problems/validate-binary-search-tree/
● https://leetcode.com/problems/lowest-common-ancestor-of-
a-binary-search-tree
● https://leetcode.com/problems/convert-sorted-array-to-
binary-search-tree
● https://leetcode.com/problems/kth-smallest-element-in-a-
bst/
Trie
● https://leetcode.com/problems/implement-trie-prefix-tree/
● https://leetcode.com/problems/design-add-and-search-
words-data-structure/
Dynamic Programming
● https://leetcode.com/problems/coin-change/
● https://leetcode.com/problems/target-sum/
● https://leetcode.com/problems/climbing-stairs
● https://leetcode.com/problems/maximum-subarray
● https://leetcode.com/problems/edit-distance/
● https://leetcode.com/problems/partition-equal-subset-sum/
● https://leetcode.com/problems/word-break
● https://leetcode.com/problems/word-break-ii/
● https://leetcode.com/problems/combination-sum-iv
● https://leetcode.com/problems/maximum-profit-in-job-
scheduling/
● https://leetcode.com/problems/minimum-cost-to-cut-a-stick/
● https://leetcode.com/problems/house-robber/
● https://leetcode.com/problems/longest-increasing-
●
subsequence
● https://leetcode.com/problems/partition-equal-subset-sum/
● https://leetcode.com/problems/decode-ways/
● https://leetcode.com/problems/maximal-square/
● https://leetcode.com/problems/jump-game
Graph
● https://leetcode.com/problems/flood-fill
● https://leetcode.com/problems/clone-graph/
● https://leetcode.com/problems/number-of-islands/
● https://leetcode.com/problems/rotting-oranges
● https://leetcode.com/problems/word-search/
● https://leetcode.com/problems/course-schedule
● https://leetcode.com/problems/course-schedule-ii
● https://leetcode.com/problems/possible-bipartition/
● https://leetcode.com/problems/cheapest-flights-within-k-
stops/
● https://leetcode.com/problems/bus-routes/
● https://leetcode.com/problems/word-search-ii/
● https://leetcode.com/problems/water-and-jug-problem/
Bits
● https://leetcode.com/problems/single-number/
● https://leetcode.com/problems/single-number-ii/
● https://leetcode.com/problems/number-of-1-bits/
● https://leetcode.com/problems/bitwise-and-of-numbers-
range/
● https://leetcode.com/problems/counting-bits
● https://leetcode.com/problems/hamming-distance/
● https://leetcode.com/problems/power-of-two/
● https://leetcode.com/problems/reverse-bits/