Pattern Recognition Phrases Flashcards

(90 cards)

1
Q

Maximum/minimum sum of any k consecutive elements

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Find longest sequence that satisfies condition

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Shortest subarray containing all

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Find all subarrays of length k where sum

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Count number of subarrays with sum k

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Maximum/minimum average of k consecutive values

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Longest substring with at most k distinct

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Smallest window that contains

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Find subarray of size k with largest sum

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Number of subarrays with exactly k different

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Find maximum for each window of size k

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Count of subarrays with sum less than k

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Find all averages of k consecutive values

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Longest subarray with sum less than k

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Maximum of all windows of size k

A

SLIDING WINDOW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Container with most water

A

TWO POINTERS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Find pair that sums to target

A

TWO POINTERS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Remove duplicates from sorted array

A

TWO POINTERS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Move all zeros to end

A

TWO POINTERS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Reverse string/array

A

TWO POINTERS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Find if palindrome

A

TWO POINTERS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Three numbers that sum to target

A

TWO POINTERS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Merge two sorted arrays

A

TWO POINTERS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Find closest pair to target

A

TWO POINTERS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Maximum area/volume between elements
TWO POINTERS
26
Sort colors/numbers in place
TWO POINTERS
27
Next permutation of sequence
TWO POINTERS
28
Trap water between heights
TWO POINTERS
29
Find pairs with difference k
TWO POINTERS
30
Squares of sorted array
TWO POINTERS
31
Find first duplicate in sequence
HASH MAP/SET
32
Count frequency of elements
HASH MAP/SET
33
Group all anagrams together
HASH MAP/SET
34
Find pairs that sum to target
HASH MAP/SET
35
Longest sequence without repeating
HASH MAP/SET
36
Find all numbers that appear more than n/k times
HASH MAP/SET
37
Check if permutation exists
HASH MAP/SET
38
Find missing number in sequence
HASH MAP/SET
39
Intersection of two arrays
HASH MAP/SET
40
Find common elements across arrays
HASH MAP/SET
41
Subarray with sum equals k
HASH MAP/SET
42
Find all pairs with difference k
HASH MAP/SET
43
Count subarrays with given sum
HASH MAP/SET
44
Find elements that appear n/2 times
HASH MAP/SET
45
Check if strings are isomorphic
HASH MAP/SET
46
Search in sorted array
BINARY SEARCH
47
Find in rotated sorted array
BINARY SEARCH
48
Find minimum in sorted array
BINARY SEARCH
49
Search insert position in sorted
BINARY SEARCH
50
Find peak element in array
BINARY SEARCH
51
Find first and last position of element
BINARY SEARCH
52
Kth missing positive number
BINARY SEARCH
53
Find smallest letter greater than target
BINARY SEARCH
54
Find perfect square root
BINARY SEARCH
55
Search in infinite sorted array
BINARY SEARCH
56
Find smallest divisor given threshold
BINARY SEARCH
57
Minimum number of days to achieve goal
BINARY SEARCH
58
Find kth positive missing number
BINARY SEARCH
59
Find distance value between arrays
BINARY SEARCH
60
Find right interval in sorted
BINARY SEARCH
61
Valid parentheses/brackets sequence
STACK
62
Next greater element in sequence
STACK
63
Evaluate expression with operators
STACK
64
Implement min/max stack operations
STACK
65
Daily temperatures/next warmer day
STACK
66
Remove all adjacent duplicates
STACK
67
Decode encoded string
STACK
68
Basic calculator implementation
STACK
69
Simplify file path
STACK
70
Remove k digits to minimize
STACK
71
Score of parentheses expression
STACK
72
Validate stack sequences
STACK
73
Pattern 132 in sequence
STACK
74
Find celebrity in graph
STACK
75
Baseball game score calculation
STACK
76
Find k largest/smallest elements
HEAP
77
Merge k sorted lists/arrays
HEAP
78
Kth largest element in sequence
HEAP
79
Sort nearly sorted/k-sorted array
HEAP
80
Connect ropes with minimum cost
HEAP
81
Find median in data stream
HEAP
82
Find k closest points to origin
HEAP
83
K most frequent elements
HEAP
84
Minimum cost to connect sticks
HEAP
85
Minimum number of refueling stops
HEAP
86
Schedule tasks with cooldown period
HEAP
87
Cheapest flights within k stops
HEAP
88
Maximum performance of team
HEAP
89
Find k pairs with smallest sums
HEAP
90
Reorganize string based on frequency
HEAP