You are on page 1of 25

Category Name Status

Arrays Contains Duplicate Done


Arrays Valid Anagram
Arrays Two Sum
Arrays Group Anagrams
Arrays Top K Frequent
Product of ArrayElements
Except Self
Arrays
Arrays Valid Sudoku
Arrays Encode and Decode Strings
Graph
Two Longest Consecutive Sequence
Pointers
Two Valid Palindrome
Pointers
Two Two Sum II
Pointers
Two 3Sum
Pointers
Two Container with Most Water
Pointers
Sliding Trapping Rain Water
Window
Sliding Best Time to Buy & Sell Stock
Window
Sliding Longest Substring Without Repeating Characters
Window
Sliding Longest Repeating Character Replacement
Window
Sliding Permutation in String
Window
Sliding Minimum Window Substring
Window Sliding Window Maximum
Stack Valid Parentheses
Stack Min Stack
Stack Evaluate Reverse Polish Notation
Stack Generate Parentheses
Stack Daily Temperatures
Stack Car Fleet
Stack
Binary Largest Rectangle in Histogram
Search
Binary Binary Search
Search
Binary Search a 2D Matrix
Search
Binary Koko Eating Bananas
Search
Binary Search Rotated Sorted Array
Search
Binary Find Minimum in Rotated Sorted Array
Search
Binary Time Based Key-Value Store
Search
Linked Find Median of Two Sorted Arrays
List
Linked Reverse Linked List
List
Linked Merge Two Linked Lists
List
Linked Reorder List
List
Linked Remove Nth Node from End of List
List
Linked Copy List with Random Pointer
List
Linked Add Two Numbers
List
Linked Linked List Cycle
List
Linked Find the Duplicate Number
List
Linked LRU Cache
List
Linked Merge K Sorted Lists
List Reverse Nodes in K-Group
Trees Invert Binary Tree
Trees Maximum Depth of Binary Tree
Trees Diameter of a Binary Tree
Trees Balanced Binary Tree
Trees Same Tree
Trees Subtree of Another Tree
Trees Lowest Common Ancestor of a BST
Trees Binary Tree Level Order Traversal
Trees Binary Tree Right Side View
Trees Count Good Nodes in a Binary Tree
Trees Validate Binary Search Tree
Trees Kth Smallest Element in a BST
Trees Construct Tree from Preorder and Inorder Traversal
Trees Binary Tree Max Path Sum
Trees Serialize and Deserialize Binary Tree
Tries Implement Trie
Tries
Heap / Design Add and Search Word Data Structure
Tries
Priority
Heap / Word Search II
Queue
Priority
Heap / Kth Largest Element in a Stream
Queue
Priority
Heap / Last Stone Weight
Queue
Priority
Heap / K Closest Points to Origin
Queue
Priority
Heap / Kth Largest Element in an Array
Queue
Priority
Heap / Task Scheduler
Queue
Priority Design Twitter
Queue
Backtrack Find Median from Data Stream
ing
Backtrack Subsets
ing
Backtrack Combination Sum
ing
Backtrack Permutations
ing
Backtrack Subsets II
ing
Backtrack Combination Sum II
ing
Backtrack Word Search
ing
Backtrack Palindrome Partitioning
ing
Backtrack Letter Combinations of a Phone Number
ing N-Queens
Graphs Number of Islands
Graphs Clone Graph
Graphs Max Area of Island
Graphs Pacific Atlantic Waterflow
Graphs Surrounded Regions
Graphs Rotting Oranges
Graphs Walls and Gates
Graphs Course Schedule
Graphs Course Schedule II
Graphs Redundant Connection
Graphs Number of Connected Components in Graph
Graphs Graph Valid Tree
Graphs
Advanced Word Ladder
Graphs
Advanced Reconstruct Itinerary
Graphs
Advanced Min Cost to Connect all Points
Graphs Network Delay Time
Advanced
Graphs
Advanced Swim in Rising Water
1-D
Graphs
Advanced
Dynamic Alien Dictionary
1-D
Graphs
Program
Dynamic Cheapest Flights with K Stops
1-D
ming
Program
Dynamic Climbing Stairs
1-D
ming
Program
Dynamic Min Cost Climbing Stairs
1-D
ming
Program
Dynamic House Robber
1-D
ming
Program
Dynamic House Robber II
1-D
ming
Program
Dynamic Longest Palindroming Substring
1-D
ming
Program
Dynamic Palindrome Substrings
1-D
ming
Program
Dynamic Decode Ways
1-D
ming
Program
Dynamic Coin Change
1-D
ming
Program
Dynamic Maximum Product Subarray
1-D
ming
Program
Dynamic Word Break
2-D
ming
Program
Dynamic Longest Increasing Subsequence
2-D
ming
Program
Dynamic Partition Equal Subset Sum
2-D
ming
Program
Dynamic Unique Paths
2-D
ming
Program
Dynamic Longest Common Subsequence
2-D
ming
Program
Dynamic Best Time to Buy/Sell Stock With Cooldown
2-D
ming
Program
Dynamic Coin Change II
2-D
ming
Program
Dynamic Target SUm
2-D
ming
Program
Dynamic Interleaving String
2-D
ming
Program
Dynamic Longest Increasing Path in a Matrix
2-D
ming
Program
Dynamic Distinct Subsequences
2-D
ming
Program
Dynamic Edit Distance
ming
Program Burst Balloons
ming Regular Expression Matching
Greedy Maximum Subarray
Greedy Jump Game
Greedy Jump Game II
Greedy Gas Station
Greedy Hand of Straights
Greedy Merge Triplets to Form Target Triplet
Greedy Partition Labels
Greedy Valid Parenthesis String
Intervals Insert Interval
Intervals Merge Intervals
Intervals Non-Overlapping Intervals
Intervals Meeting Rooms
Intervals Meeting Rooms II
Intervals
Math & Minimum Interval to Include Each Query
Geometry
Math & Rotate Image
Geometry
Math & Spiral Matrix
Geometry
Math & Set Matrix Zeroes
Geometry
Math & Happy Number
Geometry
Math & Plus One
Geometry
Math & Pow(x, n)
Geometry
Math & Multiply Strings
Geometry Detect Squares
Bit
Manipulat
Bit
ion
Manipulat
Bit Single Number
ion
Manipulat Number of 1 Bits
Bit
ion
Manipulat
Bit Counting Bits
ion
Manipulat Reverse Bits
Bit
ion
Manipulat
Bit Missing Number
ion
Manipulat Sum of Two Integers
ion Reverse Integer
Link
https://leetcode.com/problems/contains-duplicate/
https://leetcode.com/problems/valid-anagram/
https://leetcode.com/problems/two-sum/
https://leetcode.com/problems/group-anagrams/
https://leetcode.com/problems/top-k-frequent-elements/
https://leetcode.com/problems/product-of-array-except-self/
https://leetcode.com/problems/valid-sudoku/
https://leetcode.com/accounts/login/?next=/problems/encode-and-decode-strings/
https://leetcode.com/problems/longest-consecutive-sequence/
https://leetcode.com/problems/valid-palindrome/
https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/
https://leetcode.com/problems/3sum/
https://leetcode.com/problems/container-with-most-water/
https://leetcode.com/problems/trapping-rain-water/
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
https://leetcode.com/problems/longest-substring-without-repeating-characters/
https://leetcode.com/problems/longest-repeating-character-replacement/
https://leetcode.com/problems/permutation-in-string/
https://leetcode.com/problems/minimum-window-substring/
https://leetcode.com/problems/sliding-window-maximum/
https://leetcode.com/problems/valid-parentheses/
https://leetcode.com/problems/min-stack/
https://leetcode.com/problems/evaluate-reverse-polish-notation/
https://leetcode.com/problems/generate-parentheses/
https://leetcode.com/problems/daily-temperatures/
https://leetcode.com/problems/car-fleet/
https://leetcode.com/problems/largest-rectangle-in-histogram/
https://leetcode.com/problems/binary-search/
https://leetcode.com/problems/search-a-2d-matrix/
https://leetcode.com/problems/koko-eating-bananas/
https://leetcode.com/problems/search-in-rotated-sorted-array/
https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
https://leetcode.com/problems/time-based-key-value-store/
https://leetcode.com/problems/median-of-two-sorted-arrays/
https://leetcode.com/problems/reverse-linked-list/
https://leetcode.com/problems/merge-two-sorted-lists/
https://leetcode.com/problems/reorder-list/
https://leetcode.com/problems/remove-nth-node-from-end-of-list/
https://leetcode.com/problems/copy-list-with-random-pointer/
https://leetcode.com/problems/add-two-numbers/
https://leetcode.com/problems/linked-list-cycle/
https://leetcode.com/problems/find-the-duplicate-number/
https://leetcode.com/problems/lru-cache/
https://leetcode.com/problems/merge-k-sorted-lists/
https://leetcode.com/problems/reverse-nodes-in-k-group/
https://leetcode.com/problems/invert-binary-tree/
https://leetcode.com/problems/maximum-depth-of-binary-tree/
https://leetcode.com/problems/diameter-of-binary-tree/
https://leetcode.com/problems/balanced-binary-tree/
https://leetcode.com/problems/same-tree/
https://leetcode.com/problems/subtree-of-another-tree/
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/
https://leetcode.com/problems/binary-tree-level-order-traversal/
https://leetcode.com/problems/binary-tree-right-side-view/
https://leetcode.com/problems/count-good-nodes-in-binary-tree/
https://leetcode.com/problems/validate-binary-search-tree/
https://leetcode.com/problems/kth-smallest-element-in-a-bst/
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/serialize-and-deserialize-binary-tree/
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/
https://leetcode.com/problems/kth-largest-element-in-a-stream/
https://leetcode.com/problems/last-stone-weight/
https://leetcode.com/problems/k-closest-points-to-origin/
https://leetcode.com/problems/kth-largest-element-in-an-array/
https://leetcode.com/problems/task-scheduler/
https://leetcode.com/problems/design-twitter/
https://leetcode.com/problems/find-median-from-data-stream/
https://leetcode.com/problems/subsets/
https://leetcode.com/problems/combination-sum/
https://leetcode.com/problems/permutations/
https://leetcode.com/problems/subsets-ii/
https://leetcode.com/problems/combination-sum-ii/
https://leetcode.com/problems/word-search/
https://leetcode.com/problems/palindrome-partitioning/
https://leetcode.com/problems/letter-combinations-of-a-phone-number/
https://leetcode.com/problems/n-queens/
https://leetcode.com/problems/number-of-islands/
https://leetcode.com/problems/clone-graph/
https://leetcode.com/problems/max-area-of-island/
https://leetcode.com/problems/pacific-atlantic-water-flow/
https://leetcode.com/problems/surrounded-regions/
https://leetcode.com/problems/rotting-oranges/
https://leetcode.com/problems/walls-and-gates/
https://leetcode.com/problems/course-schedule/
https://leetcode.com/problems/course-schedule-ii/
https://leetcode.com/problems/redundant-connection/
https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/
https://leetcode.com/problems/graph-valid-tree/
https://leetcode.com/problems/word-ladder/
https://leetcode.com/problems/reconstruct-itinerary/
https://leetcode.com/problems/min-cost-to-connect-all-points/
https://leetcode.com/problems/network-delay-time/
https://leetcode.com/problems/swim-in-rising-water/
https://leetcode.com/problems/alien-dictionary/
https://leetcode.com/problems/cheapest-flights-within-k-stops/
https://leetcode.com/problems/climbing-stairs/
https://leetcode.com/problems/min-cost-climbing-stairs/
https://leetcode.com/problems/house-robber/
https://leetcode.com/problems/house-robber-ii/
https://leetcode.com/problems/longest-palindromic-substring/
https://leetcode.com/problems/palindromic-substrings/
https://leetcode.com/problems/decode-ways/
https://leetcode.com/problems/coin-change/
https://leetcode.com/problems/maximum-product-subarray/
https://leetcode.com/problems/word-break/
https://leetcode.com/problems/longest-increasing-subsequence/
https://leetcode.com/problems/partition-equal-subset-sum/
https://leetcode.com/problems/unique-paths/
https://leetcode.com/problems/longest-common-subsequence/
https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/
https://leetcode.com/problems/coin-change-2/
https://leetcode.com/problems/target-sum/
https://leetcode.com/problems/interleaving-string/
https://leetcode.com/problems/longest-increasing-path-in-a-matrix/
https://leetcode.com/problems/distinct-subsequences/
https://leetcode.com/problems/edit-distance/
https://leetcode.com/problems/burst-balloons/
https://leetcode.com/problems/regular-expression-matching/
https://leetcode.com/problems/maximum-subarray/
https://leetcode.com/problems/jump-game/
https://leetcode.com/problems/jump-game-ii/
https://leetcode.com/problems/gas-station/
https://leetcode.com/problems/hand-of-straights/
https://leetcode.com/problems/merge-triplets-to-form-target-triplet/
https://leetcode.com/problems/partition-labels/
https://leetcode.com/problems/valid-parenthesis-string/
https://leetcode.com/problems/insert-interval/
https://leetcode.com/problems/merge-intervals/
https://leetcode.com/problems/non-overlapping-intervals/
https://leetcode.com/problems/meeting-rooms/
https://leetcode.com/problems/meeting-rooms-ii/
https://leetcode.com/problems/minimum-interval-to-include-each-query/
https://leetcode.com/problems/rotate-image/
https://leetcode.com/problems/spiral-matrix/
https://leetcode.com/problems/set-matrix-zeroes/
https://leetcode.com/problems/happy-number/
https://leetcode.com/problems/plus-one/
https://leetcode.com/problems/powx-n/
https://leetcode.com/problems/multiply-strings/
https://leetcode.com/problems/detect-squares/
https://leetcode.com/problems/single-number/
https://leetcode.com/problems/number-of-1-bits/
https://leetcode.com/problems/counting-bits/
https://leetcode.com/problems/reverse-bits/
https://leetcode.com/problems/missing-number/
https://leetcode.com/problems/sum-of-two-integers/
https://leetcode.com/problems/reverse-integer/
hashset to get unique values in
array, using for loop check if
Notes ( Fill
number in with
already existsyour
in set, if
method
yes then to solve
true, else) add to set

use hash map to instantly check for difference value, map will add index of last occurrence of a num, don’t use same element tw

Use a stack to push open parentheses, if close parentheses is encountered then use a dictionary and check if it's a match, check e
um, don’t use same element twice;

d check if it's a match, check edge cases, and empty queues, valid input and inputs where closing parentheses
Video Solution Category
https://youtu.be/KLlXCFG5TnA Arrays
https://youtu.be/1pkOgXD63yU Arrays
https://youtu.be/3OamzN90kPg Arrays
https://youtu.be/bNvIQI2wAjk Arrays
https://youtu.be/5WZl3MMT0Eg Arrays
https://youtu.be/lXVy6YWFcRM Arrays
https://youtu.be/nIVW4P8b1VA Arrays
https://youtu.be/U8XENwh8Oy8 Arrays
https://youtu.be/jzZsG8n2R9A Arrays
https://youtu.be/UuiTKBwPgAo Arrays
https://youtu.be/gVUrDV4tZfY Binary
https://youtu.be/5Km3utixwZs Binary
https://youtu.be/RyBM56RIWrM Binary
https://youtu.be/WnPLSRLSANE Binary
https://youtu.be/UcoN6UjAI64 Binary
https://youtu.be/Y0lT9Fck7qI Dynamic Programming
https://youtu.be/H9bfqozjoqs Dynamic Programming
https://youtu.be/cjWnW0hdF1Y Dynamic Programming
https://youtu.be/Ua0GhsJSlWM Dynamic Programming
https://youtu.be/Sx9NNgInc3A Dynamic Programming
https://youtu.be/GBKI9VSKdGg Dynamic Programming
https://youtu.be/73r3KWiEvyk Dynamic Programming
https://youtu.be/rWAJCfYYOvM Dynamic Programming
https://youtu.be/6aEyTjOwlJU Dynamic Programming
https://youtu.be/IlEsdxuD4lY Dynamic Programming
https://youtu.be/Yan0cv2cLy8 Dynamic Programming
https://youtu.be/mQeF6bN8hMk Graph
https://youtu.be/EgI5nU9etnU Graph
https://youtu.be/s-VkcjHqkGI Graph
https://youtu.be/pV2kpPD66nE Graph
https://youtu.be/P6RZZMu_maU Graph
https://youtu.be/6kTZYvNNyps Graph
https://youtu.be/bXsUuownnoQ Graph
https://youtu.be/8f1XPm4WOUc Graph
https://youtu.be/A8NUOmlwOlM Interval
https://youtu.be/44H3cEC2fFM Interval
https://youtu.be/nONCGxWoUfM Interval
https://youtu.be/PaJxqZVPhbg Interval
https://youtu.be/FdzJmTCVyJU Interval
https://youtu.be/G0_I-ZF0S38 Linked List
https://youtu.be/gBTe7lFR3vc Linked List
https://youtu.be/XIdigk956u0 Linked List
https://youtu.be/q5a5OiGbT6Q Linked List
https://youtu.be/XVuQxVej6y8 Linked List
https://youtu.be/S5bfdUTrKLM Linked List
https://youtu.be/T41rL0L3Pnw Matrix
https://youtu.be/BJnMZNwUk1M Matrix
https://youtu.be/fMSJSS7eO1w Matrix
https://youtu.be/pfiQ_PS1g8E Matrix
https://youtu.be/wiGpQwVHdE0 String
https://youtu.be/gqXU1UyA8pk String
https://youtu.be/jSto0O4AJbM String
https://youtu.be/9UtInBqnCgA String
https://youtu.be/vzdNOK2oB2E String
https://youtu.be/WTzjTskDFMg String
https://youtu.be/jJXJ16kPFWg String
https://youtu.be/XYQecbcd6_c String
https://youtu.be/4RACzI5-du8 String
https://youtu.be/B1k_sxOSgv8 String
https://youtu.be/hTM3phVI6YQ Tree
https://youtu.be/vRbbcKXCxOw Tree
https://youtu.be/OnSn2XEQ4MY Tree
https://youtu.be/Hr5cWUld4vU Tree
https://youtu.be/6ZnyEApgFYg Tree
https://youtu.be/u4JAi2JJhI8 Tree
https://youtu.be/E36O5SWp-LE Tree
https://youtu.be/ihj4IQGZ2zc Tree
https://youtu.be/s6ATEkipzow Tree
https://youtu.be/5LUXSvjmGCw Tree
https://youtu.be/gs2LMfuOR9k Tree
https://youtu.be/oobqoCJlHA0 Tree
https://youtu.be/BTf05gs_8iU Tree
https://youtu.be/asbcE9mZz_U Tree
https://youtu.be/q5a5OiGbT6Q Heap
https://youtu.be/YPTqKIgVk-k Heap
https://youtu.be/itmhHWaHupI Heap
Name
Two Sum
Best Time to Buy and Sell Stock
Contains Duplicate
Product of Array Except Self
Maximum Subarray
Maximum Product Subarray
Find Minimum in Rotated Sorted Array
Search in Rotated Sorted Array
3Sum
Container With Most Water
Sum of Two Integers
Number of 1 Bits
Counting Bits
Missing Number
Reverse Bits
Climbing Stairs
Coin Change
Longest Increasing Subsequence
Longest Common Subsequence
Word Break Problem
Combination Sum
House Robber
House Robber II
Decode Ways
Unique Paths
Jump Game
Clone Graph
Course Schedule
Pacific Atlantic Water Flow
Number of Islands
Longest Consecutive Sequence
Alien Dictionary (Leetcode Premium)
Graph Valid Tree (Leetcode Premium)
Number of Connected Components in an Undirected Graph (Leetcode Premium)
Insert Interval
Merge Intervals
Non-overlapping Intervals
Meeting Rooms (Leetcode Premium)
Meeting Rooms II (Leetcode Premium)
Reverse a Linked List
Detect Cycle in a Linked List
Merge Two Sorted Lists
Merge K Sorted Lists
Remove Nth Node From End Of List
Reorder List
Set Matrix Zeroes
Spiral Matrix
Rotate Image
Word Search
Longest Substring Without Repeating Characters
Longest Repeating Character Replacement
Minimum Window Substring
Valid Anagram
Group Anagrams
Valid Parentheses
Valid Palindrome
Longest Palindromic Substring
Palindromic Substrings
Encode and Decode Strings (Leetcode Premium)
Maximum Depth of Binary Tree
Same Tree
Invert/Flip Binary Tree
Binary Tree Maximum Path Sum
Binary Tree Level Order Traversal
Serialize and Deserialize Binary Tree
Subtree of Another Tree
Construct Binary Tree from Preorder and Inorder Traversal
Validate Binary Search Tree
Kth Smallest Element in a BST
Lowest Common Ancestor of BST
Implement Trie (Prefix Tree)
Add and Search Word
Word Search II
Merge K Sorted Lists
Top K Frequent Elements
Find Median from Data Stream
two
add index
element,
sorted
of
find last next
halfs,
occurrenc
pattern:
two mid
will
ewhere
prev of be a -a
hashset
check
make
apart
num, if
two
of
=subarray
find
to
half b+c,
get local
of if
passes,
left
don’tand
cant
a=prevA,
min beuse
unique
array
first
sorted
same in-isor
negative,
skip
search
values a, if
for
in
Link sorted
Notes
order,
right
element
modulo,
dynamic
b=prevB
local
dp:
array,
order max,
toin-
to
https://leetcode.com/problems/two-sum/ second
sorted,
twice;
and
program
skip
sliding b fortoif
compute
check
find
reverse, pivot,
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ target
dividing
ming:
elim
window;
write
max outis
duplicates
arr
to
in
n;
compute isand
range
mod
https://leetcode.com/problems/contains-duplicate/ duplicates
result
max-abs-
easily
guarantee for
compute
of
and
max
;val tosorted
div
sum
find
https://leetcode.com/problems/product-of-array-except-self/ num=16
shrinking
d
add
products tofor be by
bit in
portion
are
for
b,c
to
each each
use
figure
window,
at
bit,
then most
be
https://leetcode.com/problems/maximum-subarray/ expensive
prefix
two
out
prefix
left/right
two
mindful
search
,pointers,to divide it,
https://leetcode.com/problems/maximum-product-subarray/ pattern;
subarr;
initially
sorted
of carry, at
otherwise
use
left/right
res[i]
can bit
cur =
https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/ endpoints
visualize
subarrays
after
search
shift,
on
res[i
char
,for shift -bethe
https://leetcode.com/problems/search-in-rotated-sorted-array/ the
adding,
other
instead each half if
of
remaining
offset],
decoded
pointer
decision
compute
https://leetcode.com/problems/3sum/ carry
num,
mod
list; is
get
toor
for
where
in
with
tree,
expected
still each
one1,ofmin
base
max
get
prefix,
offset 1's isif
https://leetcode.com/problems/container-with-most-water/ two
height;
case
sum
then add
prev -isreal
place
prefix
the
ways? use
is =in
https://leetcode.com/problems/sum-of-two-integers/ curSum
sum;
it
subarr,
bitwise as well; xor or
&
dict
biggest
Recursion
or
n
work > +
with and
https://leetcode.com/problems/number-of-1-bits/ num
1;
wordbrea
power of-
->
build
target,
each
backward
prev cache
https://leetcode.com/problems/counting-bits/ subproble
k(remaini
2
>each <=
adjacentc
index I;
iterative and
ssubarr
m from
reverse
subarr findwith =
(n-
https://leetcode.com/problems/missing-number/ ng
dp
y_list
candidate
value;
solution,
not
each
arr
1) and
str)=True, of(n-
https://leetcode.com/problems/reverse-bits/ solution,
edges,
can
store
dfs
including
32 have
each
bits;
without
2),
athen
run sum
lot
children dfs offor =
on
https://leetcode.com/problems/climbing-stairs/ paths
cell,
last
first
n; keep
&
return
edge
each V,
of
track itself
element,
last,
True, getof ifor
https://leetcode.com/problems/coin-change/ top-down:
cases
while
elements
position
visited,
store dfs recursive dfs, fo
to
max
cache
determin
on
to V
right of
we of foreach num, ge
https://leetcode.com/problems/longest-increasing-subsequence/ recursive:
in
and
resultsgrid,
track to
subarr,
result
e,
see
it 52,V
inorder
further ofof
31,
https://leetcode.com/problems/longest-common-subsequence/ which
prev,
recursive:
then
wordbrea and if first chars are e
pick
29,
again,
to elim
optimize,
reach
prev 10, pac,
not 20
https://leetcode.com/problems/word-break/ which
k;
only
then
duplicate of
loop
we
atl;
including
foreach don’t
first/lastdfs on
https://leetcode.com/problems/combination-sum/ decoded
insert
exists,
solutions;
store
cells
last
cell,
should
one
new
otherwise if cell
way, be
https://leetcode.com/problems/house-robber/ whole
adjacent
element
is
added 1 and to
11,
interval
V
grid,
sort
to 26
isnt
pac, in in
only
each a
https://leetcode.com/problems/house-robber-ii/ unvisited
it
decoded
order,
loop, 3
need
interval,
atl,
run find
dfs, to
https://leetcode.com/problems/decode-ways/ dfs
recursive
two
then
states=
store on ways
prev
overlappi
overlap
instead
increment
each
dfs, of
of
https://leetcode.com/problems/unique-paths/ merge
not
row;
ng
cells that
removing,
cound
node
hashmap
intervals;
visited, that
https://leetcode.com/problems/jump-game/ intervals
are
visualize
for visitedthe recursive tree
count
and
hasn’t
newinterv
visited,
should
visited be
by
https://leetcode.com/problems/clone-graph/ how
marking
been
nodes
al
still could max
adjacent,
both
num
each
visited, pac
of
https://leetcode.com/problems/course-schedule/ only
visiting
divied
iterate
and atl
intervals
contigous
increment
sort
merge
https://leetcode.com/problems/pacific-atlantic-water-flow/ and
cells;
you
1 build
as can
compone
intervals
with
conquer,
solution; one
https://leetcode.com/problems/number-of-islands/ include,
visited
nt
by count,
intervalstart
merge
also
sort
adjacency
https://leetcode.com/problems/longest-consecutive-sequence/ use
time,
that
lists,
graph bruteforce
Nif and try to o
intervals,
list;
second
comes bfs
https://leetcode.com/problems/alien-dictionary/ chars
totalnode
method,
dp toto of a word not in orde
dict
and
interval
before union it, if union return f
https://leetcode.com/problems/graph-valid-tree/ s,
less
union
iterate
compute
remembek-lists,
find are find,
doesn’t
then
O(N*logk)
efficient, add
https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/ through
rmax visited
possible;
overlap
remaining
.more
For each
maintaini
https://leetcode.com/problems/insert-interval/ use
intervals
nodes;
with
intervals; first,
list,
complicat
ng
dummy
up
two curfind
until
https://leetcode.com/problems/merge-intervals/ then
min
ed third
val,
and
node
the
pointers
def prev;
i-th
wont at
https://leetcode.com/problems/non-overlapping-intervals/ insert
recursivel
head
interval;
at ofit
reverse
overlap
https://leetcode.com/problems/meeting-rooms/ yinto
different
second
with
list,
reverse,
list, first;
insert
use
return
compute
speeds,
half
each of ifabout the points in
https://leetcode.com/problems/meeting-rooms-ii/ we care
priorityQ
new
len head
theyof
list,
node then list;
meet
https://leetcode.com/problems/reverse-linked-list/ to
of
two list
there is
easily
from
optimize one
https://leetcode.com/problems/linked-list-cycle/ pointers,
loop
reorder
list into it;
finding
second
https://leetcode.com/problems/merge-two-sorted-lists/ non-
the other
min offset
has
optimal
https://leetcode.com/problems/merge-k-sorted-lists/ O(N*logk)
of n from
way is to
https://leetcode.com/problems/remove-nth-node-from-end-of-list/ first;
store list
https://leetcode.com/problems/reorder-list/ in array;
track
e, rotate of
pointers,
remembe
mark
visited
positions
update
rrow/col visited
sliding
cells;
in reverse
left
cells,
that
window,
for
keep and
each and
order,
right
remove
needs untilto
if
of
track
same
store we26 of see
aasin
each
cur
be
same
chars, visited char
https://leetcode.com/problems/set-matrix-zeroes/
boundarie
longest
push
temp,
points
cell
zeroed; right ause
at=
twice
count
s,
palindrom
opening
b, layer-
b = of
c, c
https://leetcode.com/problems/spiral-matrix/ alphanum
before
within
each
by-layer; char
ic
brace
=,you string,
d,
compared on
=
https://leetcode.com/problems/rotate-image/ curr
in
each
stack,
temp; each charpop
left
return
window,
word and
https://leetcode.com/problems/word-search/ in
if
right,
from str as
dfs;
hashmap
foreach
shift
tuple
middle start
for
matching
helper
continue
to count
https://leetcode.com/problems/longest-substring-without-repeating-characters/ char
position;
key
and
close in in
returns
until
each
str,
dict, left
char
value
https://leetcode.com/problems/longest-repeating-character-replacement/ PAY
expand
recursive
brace,
maxpaths
>= ATTENTION:
right, at limited to
in
consider
is
outwards, str1,
the list
https://leetcode.com/problems/minimum-window-substring/ dfs
end
need
um
don’t
recursive
decremen to ifis num of unique char
it
recursive
of
do
invert
stack were
same
https://leetcode.com/problems/valid-anagram/ without
distinguis
dfs
tfor
the
dfs
anagrams to
forpali
on find
str2;
subtrees;
empty,
splitting
h of
https://leetcode.com/problems/group-anagrams/ first
max-
middle,
both
;bfs
even len;
return
store
branches,
between
element
depth to
https://leetcode.com/problems/valid-parentheses/ consider
trees
maybe
invert
true;
length atofof
inside
upper/lo
in
subtrees;
if
trick
the pre-
pali is
same was
read
levels,
str
helper beforeup use
https://leetcode.com/problems/valid-palindrome/ wercase;
order
iterative
odd
use
time;
on
non-
collection or we
built is
https://leetcode.com/problems/longest-palindromic-substring/ each
also
root,
bfs
even; to
in
iterative
manacher
optimal
s.deque;
string python and
update
elements
count
node
min/max
bfs has
https://leetcode.com/problems/palindromic-substrings/ smaxSum
maintain
store
iterative
delimiteralg tree
left
number
children
iterative
values
compare of
https://leetcode.com/problems/encode-and-decode-strings/ curr
in
dfs
like
by
root sorted
is'#';
in easyin-
of
character
bfs,
float("inf"
each
median, levels
addlevel
https://leetcode.com/problems/maximum-depth-of-binary-tree/ array;
with
computin
we
order
in tree stack
are
s,
prev
),
of
and
iterative
if and
"-inf",
both
doing level
all
https://leetcode.com/problems/same-tree/ gas
always
left
bool
which
trees if its
num
dfs
pre-order
traverse
compare
maxpaths
want
subtree, in- thes
https://leetcode.com/problems/invert-binary-tree/ an
doesn't
paramete
greater
order
traversal ending andif
to
p,
um
min
right
character,
have check
q WITH
ofof
any
rs;
than
return
any med the
https://leetcode.com/problems/binary-tree-maximum-path-sum/ values
aiterative
the
root
node
nulls split; toto
are
in
kth
subtree
curr
current
right a in
https://leetcode.com/problems/binary-tree-level-order-traversal/ DOESN’T
the
in-order
minHeap,
element result;
sfrontier,
node, equals
subtree,
have or t;single non-null no
https://leetcode.com/problems/serialize-and-deserialize-binary-tree/ traversal,
bfs
and
processed
merkle every
all
base
we
recursivel
need
check can= case:
https://leetcode.com/problems/subtree-of-another-tree/ ,if
num char
go
hashing?
one
store
y"." build isless
left in is
char,
minheap
each
than
until run val
med
null,
https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ left,
frontier
subtrees;
since
that’s
greater other
root in
search
in
pop,
in aright go for
https://leetcode.com/problems/validate-binary-search-tree/ heap
node
kept
than
remaining of
at
prev;
maxHeap,
right
subtree,
size
https://leetcode.com/problems/kth-smallest-element-in-a-bst/ size kk,for
doesn’t
portion
after
once; if of
then
efficient
have
its biggercurr
aon
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/ word
every
is lca;only
pop/push
char,
than
all of kcurr
insertion
;popdivide
https://leetcode.com/problems/implement-trie-prefix-tree/ children;
nodes
update the
https://leetcode.com/problems/add-and-search-word-data-structure-design/ and
min,
children; by
median
conquer
https://leetcode.com/problems/word-search-ii/ the
dependin end
trick: I though it use trie to st
merging
should be
https://leetcode.com/problems/merge-k-sorted-lists/ glists;
on
left
odd/evenwith k
https://leetcode.com/problems/top-k-frequent-elements/ largest;
num of
https://leetcode.com/problems/find-median-from-data-stream/ elements;
top-down: recursive dfs, for amount, branch for each coin, cache to store prev coin_count for each amount; bottom-up: compute coins f
recursive: foreach num, get subseq with num and without num, only include num if prev was less, cache solution of each; dp=subseq len
recursive: if first chars are equal find lcs of remaining of each, else max of: lcs of first and remain of 2nd and lcs of 2nd remain of first, cac

visualize the recursive tree, cache solution for O(n) time/mem complexity, iterative is O(1) mem, just iterate backwards to see if element

use bruteforce and try to optimize, consider the max subseq containing each num; add each num to hashset, for each num if num-1 does
chars of a word not in order, the words are in order, find adjacency list of each unique char by iterating through adjacent words and findi
union find, if union return false, loop exists, at end size must equal n, or its not connected; dfs to get size and check for loop, since each e

we care about the points in time where we are starting/ending a meeting, we already are given those, just separate start/end and traver
PAY ATTENTION: limited to chars A-Z; for each capital char, check if it could create the longest repeating substr, use sliding window to op
need is num of unique char in T, HAVE is num of char we have valid count for, sliding window, move right until valid, if valid, increment le

bfs every single non-null node is added to string, and it's children are added too, even if they're null, deserialize by adding each non-null n

trick: I though use trie to store the grid, reverse thinking, instead store dictionary words, dfs on each cell, check if cell's char exists as child
t; bottom-up: compute coins for amount = 1, up until n, using for each coin (amount - coin), cache prev values
lution of each; dp=subseq length which must end with each num, curr num must be after a prev dp or by itself;
d lcs of 2nd remain of first, cache result; nested forloop to compute the cache without recursion;

e backwards to see if element can reach goal node, if yes, then set it equal to goal node, continue;

et, for each num if num-1 doesn’t exist, count the consecutive nums after num, ie num+1; there is also a union-find solution;
ough adjacent words and finding first chars that are different, run topsort on graph and do loop detection;
nd check for loop, since each edge is double, before dfs on neighbor of N, remove N from neighbor list of neighbor;

separate start/end and traverse counting num of meetings going at these points in time; for each meeting check if a prev meeting has fini
bstr, use sliding window to optimize; check if windowlen=1 works, if yes, increment len, if not, shift window right;
ntil valid, if valid, increment left until invalid, to check validity keep track if the count of each unique char is satisfied;

alize by adding each non-null node to queue, deque node, it's children are next two nodes in string;

heck if cell's char exists as child of root node in trie, if it does, update currNode, and check neighbors, a word could exist multiple times in
on-find solution;

heck if a prev meeting has finished before curr started, using min heap;
d could exist multiple times in grid, so don’t add duplicates;

You might also like