Dsa Pattern
Dsa Pattern
Clue
Questions
You're given a graph, and you need to identify distinct
subgraphs where all vertices are connected to each
other by paths.
Look for problems where you need to color the graph with a minimum
number of colors without violating the coloring rule.
You
encounter
a problem
You
where
encounter
recursive
a problem You
calls result You You
You where you You encounter
in encounter encounter
encounter need to encounter a problem
redundant a problem a problem
a problem optimize a problem where you
computati where an where you
where you the where you need to
ons, optimal need to
need to allocation need to count the
leading to solution divide a
find of efficiently number of
Scenari inefficienc can be set of
optimal resources compute ways to
os DP y. The constructe
solutions to cumulative achieve a
intervals
problem d from into the
for maximize sums or certain
can be optimal minimum
subinterva or counts outcome,
optimized solutions number of
ls within a minimize a over a subject to
by storing of its non-
larger value, range of certain
the results subproble overlappin
interval. subject to elements. constraint
of ms. g subsets.
capacity s.
previous
constraint
computati
s.
ons in a
data
structure.
Look for Look for
Look for Look for Look for
problems Look for problems
problems problems problems
where you problems where you
where the where the where you
need to where you can sort
Look for optimal optimal can
select can define the
recursive solution to solution preproces
items from states intervals
problems the for a given s the array
a set to representi by their
where problem interval to
maximize ng counts, endpoints
Clue subproble can be can be
or
compute
and and use
ms are formed by derived prefix
minimize a transitions dynamic
overlappin combining from sums or
value between programmi
g or optimal optimal counts,
without states ng to find
repetitive. solutions solutions enabling
exceeding correspon the
of its of its fast query
capacity d to valid optimal
subproble subinterva operations
constraint outcomes. partitionin
ms. ls. .
s. g.
Fibonacci Number:
Maximumhttps://leetcode.com/problems/fibonacci-number/
Subarray:
Minimum Falling
https://leetcode.com/problems/maximum-subarray/
0/1 Knapsack:
Path Subarray
Sum:
https://leetcode.com/problems/01-knapsack
https://leetcode.com/problems/minimum-
Sum
Unique
Equals
Paths
Non-overlapping
K: https://leetcode.com/pr
III: https://leetcode.com
Intervals:
Climbing Stairs:
Longesthttps://leetcode.com/problems/climbing-stairs/
Increasing
Burst Balloons:
Subsequence:
Partition
https://leetcode.com/problems/burst-balloons/
Equal
Range
https://leetcode.com/problems/longest-increas
Subset
SumDistinct
Sum:
Queryhttps://leetcode.com/problems
-Subsequences:
Immutable:
Partition Labels:
https://leetcode
https://leetco
https://lee
House Robber:
Coin https://leetcode.com/problems/house-robber/
Change:Partition
https://leetcode.com/problems/coin-change/
Equal
Target
Subset
Sum:
Count
Sum:
https://leetcode.com/problems/target-sum/
of
https://leetcode.com/problems/partition-e
Range
CountSum:
Different
Maximum
https://leetcode.com/prob
Palindromic
NumberSubsequ
of Non-
Questio
ns
Unique Paths:
Edithttps://leetcode.com/problems/unique-paths/
Distance:
Strange
https://leetcode.com/problems/edit-distance/
Printer:
Minimum
https://leetcode.com/problems/strange-printer/
Subset
Number Sum
of Count
Submatrices
Difference:
Numbers
Split
https://leetcode.com/pro
That
Array
with
SumUnique
into
to Target:
Consecutiv
Digits:
htt
h
Minimum Path
Longest
Sum:Common
https://leetcode.com/problems/minimum-path-sum/
Maximum Subsequence:
Vacation
Equal Subset
Days:
Subarray
https://leetcode.com/problems/longest-common
Sum
https://leetcode.com/problems/maximum-v
Partition:
Sums
CountDivisible
of
https://leetcode.com/problems
Smaller
Longest
by K:
Numbers
Continuous
https://leetcode.c
AfterIncrea
Self:
Probabilit
y&
Expectati
ons
You
encounter a
problem
where you
need to
compute the
probability of
certain
events or
the expected
value of a
random
variable.
Look for
problems
where you
can model
the
problem
using
probability
distributio
ns or
expected
values
and use
dynamic
programmi
ng to
compute
them
efficiently.
You need
to solve
You're
graph-
tasked
You have You need You need related
with
a large You're to find the to problems
You have designing
dataset, analyzing maximum construct, efficiently
K sorted a custom
and you data and or modify, or using
lists and data
Scenari need to need to
need to
minimum
structure
manipulat priority
efficiently identify element in e data queues for
os find the the most
merge
all
using
structures operations
them into priority
Kth largest frequently contiguou using like
a single queues to
or occurring s priority Dijkstra's
sorted list. solve
smallest elements. subarrays queues algorithm
specific
element. of size K. efficiently. or finding
problems
minimum
efficiently.
spanning
trees.
Look for Look for Look for
Look for Look for
Look for problems Look for problems problems
problems problems
problems where you problems where you where you
where you where you
where you need to where maintain a construct
need to process
need to track you're sliding or
design a nodes or
track the K element required to window of manipulat
data edges
largest or frequencie merge fixed size e data
Clue smallest s and multiple and
structure
structures
based on
using their
elements select the sorted efficiently based on
priority weights or
while top K sequence find the specific
queues for distances
processin elements s while maximum rules
various in graph-
g the based on maintainin or using
functionalit related
dataset. occurrenc g order. minimum priority
ies. scenarios.
e count. element. queues.
Kth LargestTop
Element
K Frequent
in
Merge
an Array:
Elements:
k Sorted
Sliding
https://leetcode.com/problems/kth-largest-element-in-an-a
https://leetcode.com/problems/top-k-frequent-elemen
Lists:
Window
Design
https://leetcode.com/problems/merge-k-sorted-l
Maximum:
Twitter:
Task https://leetcode.com/problems/d
Scheduler:
https://leetcode.com/problems/
Networkhttps://leetcode.com
Delay Time: https
Kth Smallest
Sort
Element
Characters
Merge
in a Sorted
BySorted
Frequency:
Maximum
Matrix:
Array:https://leetcode.com/problems/kth-smallest-eleme
https://leetcode.com/problems/sort-characters-by
https://leetcode.com/problems/merge-sorted-arr
Sum
Designof Subarray
Hit Rearrange
Counter:
of Size
https://leetcode.com/proble
Cheapest
String
K: https://leetcode.com/
k Distance
Flights Within
Apart: Kh
Find Median
Top
from
K Frequent
Data
Merge
Stream:
Words:
Intervals:
https://leetcode.com/problems/find-median-from-data-strea
Minimum
https://leetcode.com/problems/top-k-frequent-words/
https://leetcode.com/problems/merge-intervals/
Window
Design Browser
Substring:
Reorganize
History:
https://leetcode.com/problem
Path
String:
https://leetcode.com/pr
withhttps://leetcode.co
Maximum Proba
Questio
ns
K Closest Points
Top Kto
Frequent
Origin:
Find https://leetcode.com/problems/k-closest-points-to-origin/
Smallest
Elements
MaxCommon
in
Consecutive
a Sorted
Design
Number:
Matrix:
Ones
Snake
Distant
https://leetcode.com/problems/find-s
https://leetcode.com/problems/top-
III:Game:
https://leetcode.com/problems/m
Barcodes:
https://leetcode.com/probl
The Maze https://leetcode.co
II: https://leetco
Kth LargestMaximum
Element in
Frequency
Smallest
a Stream:
Range
Stack:
Longest
https://leetcode.com/problems/kth-largest-element-in-a-s
Covering
https://leetcode.com/problems/maximum-frequency
Continuous
Design
Elements
a Leaderboard:
Subarray
Rearrange
from With
K Lists:
Kth
Words
https://leetcode.com/pro
Absolute
Smallest
https://leetcode.com
in a Sentence:
Diff
Element
Less Than
in
http
a
Pattern Validation
Mirror & Path Sum
Construct Traversal &
Type Traversal ion
Symmetr & Root to
& Search Propertie
TREES y Leaf
s
You need
You need You need to search
to visit to create a for a
You are You need
each node binary tree specific
tasked You need to validate
in the tree from given value or
with to find properties
exactly input data, perform
determinin paths in a of a binary
once, such as other
g whether binary tree tree, such
exploring an array, queries on
a binary that sum as
Scenari all nodes inorder a binary
tree is up to a whether
os in a and
symmetric target
tree, such
it's a
specific preorder/p as finding
or value or binary
order ostorder the lowest
transformi enumerate search
(e.g., traversal common
ng it into all root-to- tree or a
inorder, sequence ancestor
its mirror leaf paths. balanced
preorder, s, or level or the kth
image. tree.
postorder) order smallest/la
. traversal. rgest
element.
Explore Explore
problems Look for problems
where you Explore problems where you
Look for must build Look for problems where you verify
problems a binary problems where you apply specific
where you tree based where you traverse different conditions
must visit on compare the tree traversal or
each node provided the left while technique properties
systematic specificati and right keeping s or of binary
ally ons, subtrees track of search trees,
Clue without reconstruc recursively the path algorithms such as
missing ting the or swap and its specific to BST
any, often tree from the left sum, binary validation,
requiring its and right recursively trees, balancedn
recursion serialized children to exploring such as ess
or form or achieve all inorder checks, or
iteration. given symmetry. possible traversal identifying
traversal paths. or binary the
sequence search. diameter
s. of the tree.
Binary TreeConstruct
Inorder Traversal:
Binary
Invert Tree
Binary
https://leetcode.com/problems/binary-tree-inorder-traversal/
Path
from
Tree:
Sum:
Preorder
https://leetcode.com/problems/invert-binary-tree/
Lowest
https://leetcode.com/problems/path-sum/
andCommon
Inorder
Diameter
Traversal:
Ancestor
of Binary
of
https://leetcode.com
aTree:
Binaryhttps://leetc
Tree: http
Binary TreeConstruct
Preorder Binary
Traversal:
Symmetric
Treehttps://leetcode.com/problems/binary-tree-preorder-travers
Path
Tree:
fromSum
Inorder
https://leetcode.com/problems/symmetric-tree/
II:
Binary
https://leetcode.com/problems/path-sum-ii/
and Tree
Postorder
Count
LevelComplete
Traversal:
Order Traversal
Tree
https://leetcode.com
Nodes:
II: https://leet
https://l
Questio
ns
Binary TreeConstruct
PostorderBinary
Flip
Traversal:
Equivalent
TreeSum
https://leetcode.com/problems/binary-tree-postorder-trave
fromBinary
Root
Preorder
to
Search
Trees:
Leaf
and Numbers:
in
https://leetcode.com/problems/flip-equiv
Postorder
aBalanced
Binaryhttps://leetcode.com/problems
Search
Traversal:
BinaryTree:
Tree:
https://leetcode.co
https://leetcode
https://leetcod
Binary TreeDaily
LevelTemperatures:
Order
Convert
Traversal:
Sorted
https://leetcode.com/problems/daily-temperatures/
Binary
https://leetcode.com/problems/binary-tree-level-order-tr
Array
TreeValidate
toMaximum
BinaryBinary
Search
Binary
PathSearch
Sum:
Tree:
Tree https://leetcode.com/prob
Longest
https://leetcode.com/pro
Tree: https://leetcode.co
Consecutive Seq
Binary TreeRemove
Zigzag Level
Duplicate
Convert
Order
Letters:
Sorted
Traversal:
Path List
Sum
https://leetcode.com/problems/remove-duplicate-lett
to
https://leetcode.com/problems/binary-tree-zigzag
III:
Closest
Binary
https://leetcode.com/problems/path-sum-iii/
Search
Binary
Subtree
Search
Tree:
ofhttps://leetcode.com/probl
Another
Tree Value:
Tree:
https://leetco
https://leetc
Pattern Sliding
Expressio
Window
Type Design Monotoni n Two
&
Stack Problems c Stack Evaluatio Stacks Monotoni
Queue n
c Queue
You need
You
to
encounter
maintain a
a problem
You You need sliding
where you
encounter to window or
need to
problems maintain a find the
find the
involving specific maximum/
nearest
arithmetic order or minimum
When you smaller or
need to or logical perform element in
greater
design and expressio operations a window
element to
Scenari implement a n efficiently efficiently,
the left or
os custom data
right in an
evaluation by utilizing often used
structure , where two in
based on array. For
you need stacks, problems
stacks. example,
to parse such as involving
finding the
and simulating data
nearest
compute a queue stream
greater
expressio using two processin
element
ns. stacks. g or
on the
window-
right in an
based
array.
statistics.
Look for
Look for Look for problems
Look for problems problems where you
problems where you where you need to
Look for
that need to can process
problems
require maintain a simulate a elements
that
you to monotonic specific in a sliding
involve
design a increasing behavior window or
evaluating
Clue stack- or
arithmetic
or maintain
based decreasin implement monotonic
expressio
system or g stack to operations ity in a
ns or
implement efficiently efficiently queue,
postfix
specific track by especially
notation
functionalit elements' employing in array-
ies. positions two related or
or values. stacks. streaming
problems.
ImplementNext
QueueGreater
using
Basic
Element
Stacks:
Calculator
Evaluate
https://leetcode.com/problems/implement-queue-using-sta
I: https://leetcode.com/problems/next-greater-element-i/
II: https://leetcode.com/problems/basic-calculator-ii/
Reverse
Sliding Polish
Window Notation:
Maximum:https://leetcode.com/pro
https://leetcode.com
ImplementLargest
Stack using
Rectangle
Evaluate
Queues:
inDivision:
Histogram:
Min
https://leetcode.com/problems/implement-stack-using-que
Stack:
https://leetcode.com/problems/evaluate-division/
Design
https://leetcode.com/problems/min-stack/
https://leetcode.com/problems/largest-rectangle
Circular Deque: https://leetcode.com/pro
Questio
ns
Design Browser
Online
History:
Stock
Simplify
Span:
https://leetcode.com/problems/design-browser-history/
Path:
https://leetcode.com/problems/online-stock-span/
Design
https://leetcode.com/problems/simplify-path/
a Stack
Moving
With
Average
Increment
fromOperation:
Data Stream:
https://leetcode
https://leetc
You have
a problem
where you
You need
need to
You need Solving to reverse
find pairs
to simplify problems the linked
of
edge that list in-
elements
cases, require place
that meet
such as traversal without
certain
Scenari conditions, handling or using
an empty manipulati extra
os such as
list or on of the space,
the
adding/re linked list typically
midpoint
moving structure by
of the
elements in a modifying
linked list,
at the recursive the
detecting
beginning. manner. pointers
cycles, or
iteratively.
removing
specific
elements.
Look for
problems
Problems
that Problems
where
involve often Look for
you're
traversing involve problems
asked to
the linked scenarios where a
reverse
list where recursive
the linked
efficiently dealing approach
list or
using two with the provides
perform
Clue pointers head of an elegant
operations
simultane the linked solution,
on
ously, list is such as
segments
often cumberso dividing it
without
requiring me or into
using
pointer requires subproble
additional
manipulati special ms.
data
on or treatment.
structures.
compariso
n.
Middle of the
AddLinked
Two Numbers:
List:
Swap https://leetcode.com/problems/middle-of-the-linked-list/
Nodes
https://leetcode.com/problems/add-two-numbers/
Reverse
in Pairs:
Linked
https://leetcode.com/problems/swap-nodes-in-p
List: https://leetcode.com/problems/reverse
Intersection
Merge
of Two
Two
Linked
Palindrome
Sorted
Lists:
Lists:
Swap
https://leetcode.com/problems/intersection-of-two-linked-l
Linked
https://leetcode.com/problems/merge-two-sorted-lists/
Nodes
List: in
https://leetcode.com/problems/palindrome-lin
Pairs: https://leetcode.com/problems/swap-
Questio
Linked List Partition
Cycle: https://leetcode.com/problems/linked-list-cycle/
List:
Remove
https://leetcode.com/problems/partition-list/
Duplicates
Rotate List:
fromhttps://leetcode.com/problems/rotate-list/
Sorted List II: https://leetcode.com/problems
ns
Remove Nth
Remove
Node From
Duplicates
Flatten
End of
a from
Multilevel
List:
Reorder
Sorted
https://leetcode.com/problems/remove-nth-node-from-
List:
Doubly
List:
https://leetcode.com/problems/reorder-list/
https://leetcode.com/problems/remove-dup
Linked List: https://leetcode.com/problems
Odd Even Linked List: https://leetcode.com/problems/odd-even-linked-list/
Split Linked List in Parts: https://leetcode.com/problems/sp
Implement
basic
recursive Break down Explore all Search for a
potential
functions a problem solutions to target
that solve into smaller a problem element or
a problem subproblems
of the same
by trying out
solution
recursively
by dividing type, solve different by exploring
choices and
Scenari it into subproblem
each
backtracking
different
smaller branches of
os when a
instances recursively, dead-end is a search
of the and combine reached, space until
their the target is
same solutions to
undoing
found or the
problem choices and
solve the search
trying
until a original
alternative
space is
base case problem. paths.
exhausted.
is
reached.
Problems
Tasks where
involving
Problems the solution
searching
where the to a larger
for specific
solution can problem can
Problems elements or
be naturally be obtained
where you solutions in
expressed in by
need to find a structured
terms of recursively
all or
smaller combining
permutation unstructured
instances of solutions to
s, search
the same smaller
combination space.
Clue problem, instances of
s, or subsets Tasks
such as the same
of elements requiring
factorial problem,
while finding paths
calculation, such as
satisfying in mazes,
Fibonacci binary
specific solving
sequence search or
constraints. Sudoku
generation, finding
puzzles, or
or maximum or
searching
exponentiati minimum
for elements
on. elements in
in a tree or
an array.
graph.
Generate
Binary Parenthes
Search: es:
https://leet https://leet
code.com/ code.com/ Sudoku Solver: https://leetcode.com/problems/sudoku-solv
Factorial: https://leetcode.com/problems/factorial/
problems/ problems/
binary- generate-
search/ parenthes
es/
Fibonacci Number:
Merge Sort:
https://leetcode.com/problems/fibonacci-number/
Combination
https://leetcode.com/problems/sort-an-array/
Number
Sum: https://leetcode.com/problems/combination-sum/
of Islands: https://leetcode.com/problems/number
N-
Queens:
https://leet
Pow(x, n): https://leetcode.com/problems/powx-n/
Quick Sort: https://leetcode.com/problems/sort-an-array/
Path Sum: https://leetcode.com/problems/path-sum/
code.com/
problems/
n-queens/
Questio
ns
Letter
Combinati
ons of a
Maximum Phone
Subarray: Number:
https://leet https://leet
code.com/
Greatest Common code.com/
Divisor of Strings:
Wordhttps://leetcode.com/problems/greatest-common-divis
Search II: https://leetcode.com/problems/word-search
problems/ problems/l
maximum- etter-
subarray/ combinati
ons-of-a-
phone-
number/
Word
Search:
https://leet
code.com/
Minimum Moves to Move a Box to Their Target Location: https://leetcode.com/problems/min
problems/
word-
search/
Pattern
Basic Allocatio Counting Bitonic
Type Range
Binary n Occurenc Array
binary Search
Search
Problems es Search
search
Involves
searching Involves Involves
for a searching Involves Involves searching
target for the dividing counting the for an
element in maximum or resources or number of element in a
Scenari a sorted minimum items among occurrences bitonic array,
value that multiple of a specific which first
os array by satisfies a entities while value or increases
repeatedly specific optimizing a satisfying a and then
dividing condition certain certain decreases
the search within a criterion. condition. (or vice
given range. versa).
interval in
half.
Look for
scenarios
where
resources
need to be Look for
Look for
distributed scenarios
scenarios Look for
among where you
Look for where you scenarios
entities need to
scenarios need to where the
with count
where the optimize a array
certain occurrenc
array is value exhibits a
constraint es or
sorted, within a bitonic
s, and the determine
Clue and you given
goal is to the
behavior,
need to range, and you
optimize a frequency
find a such as need to
certain of certain
specific maximizin find an
criterion, elements/
element g or element
such as values in a
efficiently. minimizing within it
minimizing sorted
a certain efficiently.
the array or
condition.
maximum range.
or
maximizin
g the
minimum.
Search Insert
Split
Position:
Array Allocate
Largest
https://leetcode.com/problems/search-insert-position/
Sum:
Minimum
Findhttps://leetcode.com/problems/split-array-largest-sum/
First
Number
and
FindLast
Peak
of Pages:
Position
Element:
https://www.interviewbit.com/pro
of Element
https://leetcode.com/proble
in Sorted Array: http
Find Minimum
FindinKth
Rotated
Smallest
Minimize
Sorted
Element
Maximum
Count
Array:
inNegative
https://leetcode.com/problems/find-minimum-in-rot
a Pair
Sorted
FindSum
in
Numbers
Matrix:
Mountain
in Array:
https://leetcode.com/problems/kth
in https://leetcode.com/problems
Array:
a Sortedhttps://leetcode.com/pro
Matrix: https://leetcod
Questio
ns
Peak IndexCapacity
in a Mountain
ToDivide
Ship
Array:
Packages
Chocolate:
Search
https://leetcode.com/problems/peak-index-in-a-mountain-a
Within
https://leetcode.com/problems/divide-chocolate/
a 2D
Longest
Matrix
D Days:Mountain
II:https://leetcode.com/problems/capac
https://leetcode.com/problems/searc
in Array: https://leetcode.com
Find Smallest
Maximum
Letter Greater
Average
MaximumThan
Subarray
Distance
Find
Target:
Minimum
I: to
https://leetcode.com/problems/maximum-average
https://leetcode.com/problems/find-smallest-lette
Peak
GasinStation:
Index
Rotated
in https://leetcode.com/problems/min
aSorted
MountainArray
Array:
II: https://leetcode.c
https://leetcode
Valid Perfect Square: https://leetcode.com/problems/valid-perfect-square/
Count Primes:
Maximum
https://leetcode.com/problems/count-primes
Value at a Given Index in a Bounded
X Problem :
Link
Pattern String Regular
Two Sliding Hashmap
Type Pointers Window s
Manipulat Expressio
string ion ns
Apply
Utilize string
regular
Utilize two Apply sliding Employ manipulation expressions
pointers window hashmaps techniques
when the
technique when the when tasked
when the when you problem with
problem
problem need to find involves involves
operations
pattern
involves a contiguous frequency such as
matching or
searching substring counting, reversing,
string
for pairs or within the grouping splitting,
validation
string with characters joining, or
triplets of specific based on converting
based on
characters properties specific
some strings into
Scenari rules,
within a (e.g., property, or different
especially
os string that maximum checking for formats. complex
satisfy sum, the These
patterns or
minimum existence of techniques
specific size, longest certain are useful
constraints.
conditions, length) and characters in for parsing Regular
expressions
particularl you can the string. input,
provide a
y in sorted adjust the Hashmaps formatting powerful
strings or window size offer efficient output, or way to
dynamically storage and transforming
when the as you retrieval of strings
search,
order validate, and
traverse the characters according to
matters. manipulate
string. by keys. specific
text
rules.
efficiently.
Look for Phrases like
Look for
problem "count,"
phrases like
descriptions "frequency,"
"pattern,"
mentioning Problems "group," or
"validation,"
the need to involving "exist" Problem
"matching,"
compare contiguous suggest the descriptions
or specific
characters substrings potential use mentioning
patterns
from both often hint at of hashmaps operations
(e.g., email
ends of the the use of in the like
addresses,
string or to sliding problem. "manipulate,
phone
traverse the window Problems " "convert,"
numbers) in
string technique. requiring "parse," or
problem
simultaneou Look for counting specific
descriptions.
Clue sly with two phrases like occurrences, string
Problems
pointers. "substring," grouping operations
requiring
Phrases like "contiguous similar (e.g.,
validation of
"pair of characters," characters, reversing,
input strings
characters," "sliding or checking splitting)
against
"triplet of window," or for the indicate the
specific
characters," hints that a presence of need for
patterns or
or "sorted window specific string
constraints
string" needs to characters manipulation
often
indicate the slide through often techniques.
suggest the
potential the string. indicate the
application
application application
of regular
of two of
expressions.
pointers. hashmaps.
Valid Palindrome:
Minimumhttps://leetcode.com/problems/valid-palindrome/
Window
Group Anagrams:
Substring:
Reversehttps://leetcode.com/problems/group-anagrams/
https://leetcode.com/problems/minimum-window-s
String:
Regularhttps://leetcode.com/problems/reverse-stri
Expression Matching: https://leetcode.c
Reverse Words
Longest
in aSubstring
String:
First Unique
https://leetcode.com/problems/reverse-words-in-a-string/
Without
Reverse
Character
Repeating
Integer:
Regular
in a Characters:
String:
https://leetcode.com/problems/reverse-in
Expression
https://leetcode.com/problems/first
https://leetcode.com/problems
Matching (with support for '
Questio
ns Longest Palindromic
Longest Substring
Substring:
Valid Anagram:
with
https://leetcode.com/problems/longest-palindromic-substrin
String
At Most
https://leetcode.com/problems/valid-anagram/
to Integer
KWildcard
Distinct
(atoi):
Matching:
Characters:
https://leetcode.com/problems/strin
https://leetcode.com/problem
https://leetcode.com/probl
ImplementFind
strStr():
All Anagrams
https://leetcode.com/problems/implement-strstr/
LongestinPalindromic
aCount
String:
andhttps://leetcode.com/problems/find-all-anagrams-i
Substring:
Decode
Say: https://leetcode.com/problems/count-and-s
String:
https://leetcode.com/problems/longes
https://leetcode.com/problems/d
Remove Duplicates
Longest Repeating
from
String
Sorted
Compression:
Character
Implement
Array: https://leetcode.com/problems/remove-duplicates-fr
Replacement:
https://leetcode.com/problems/string-compressio
Validate
strStr(): IP
https://leetcode.com/problems/implem
Address:
https://leetcode.com/problems/longe
https://leetcode.com/proble
Pattern
Two Merge Sliding Prefix
Type Pointers Intervals Sorting
Window Sums
array
- Consider
problems
- Look for
where you
problems - Consider - Identify
- Identify need to
where you problems problems
problems compute
need to where involving
involving cumulative
iterate arranging contiguous
intervals or sums or
through the elements in subarrays or
ranges of averages of
array with a specific substrings
values, such elements in
two pointers, order can where you
as time subarrays or
typically simplify need to
intervals, answer
starting from searching, maintain a
scheduling, queries
different counting, or window of
or about
ends or comparing elements
overlapping subarray
Scenari positions elements and slide it
events. sums
within the efficiently. across the
os array.
- Look for
- Look for array.
efficiently.
tasks where - Look for
- Consider tasks where - Look for
you need to tasks where
tasks that sorting tasks where
combine or precomputin
involve elements you need to
compare g sums or
comparing according to track a
intervals, other
or certain subset of
merge aggregate
manipulating criteria can elements
overlapping values can
elements lead to a within the
intervals, or help reduce
from two solution or array that
find the time
different optimize satisfies
intersections complexity
parts of the subsequent specific
between of
array operations. conditions.
them. operations
simultaneou
involving
sly.
subarrays.
Look for
Look for
problems
problems
involving
where the Look for
Look for contiguou
Look for input problems
problems s
problem involves mentionin
mentionin subarrays,
descriptio intervals g subarray
g that the hints that
ns represente sums,
array a
mentionin d as pairs cumulative
needs to "window"
g a sorted of start sums, or
be sorted needs to
array or and end range
Clue the need points,
first or slide
sums, and
hints that through
to and the hints that
sorting the array,
compare task precomput
might or mention
elements revolves ing sums
facilitate of
from both around might
the properties
ends of combining optimize
solution like
the array. or the
process. "maximum
manipulati solution.
sum" or
ng these
"minimum
intervals.
length."
3Sum Closest:
Non-overlapping
https://leetcode.com/problems/3sum-closest/
LargestIntervals:
Number:
Longest
https://leetcode.com/problems/non-overlapping-inter
https://leetcode.com/problems/largest-number/
Continuous
Count of Range
Increasing
Sum:Subsequence:
https://leetcode.com/prob
https://leetco
Questio
ns
Remove Duplicates
Interval List
from
Wiggle
Intersections:
Sorted
SortMaximum
Array:
II: https://leetcode.com/problems/wiggle-sort-ii/
https://leetcode.com/problems/interval-list-intersectio
https://leetcode.com/problems/remove-duplicates-fr
Points
Subarray
YouProduct
Can Obtain
Less from
ThanCards:
K: https://leetcode.
https://leetco
Squares of a Sorted Array:
Mergehttps://leetcode.com/problems/squares-of-a-sorted-array/
Sorted
Maximum
Array: https://leetcode.com/problems/merge-sorted-arr
Product
Find All Subarray:
Duplicateshttps://leetcode.com/problem
in an Array: https://leetcode.