Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Maximum Product Subarray
Bookmark
Input
Classic
Negative Pairs
Two Negatives
With Zero
Custom
nums
=
[2, 3, -2, 4]
0
1
2
3
2
3
-2
4
algo
master
.
io
Step:
Track both the max and min running products, a negative number can flip the min into the max
0 / 11
Input
Classic
Negative Pairs
Two Negatives
With Zero
Custom
nums
=
[2, 3, -2, 4]
0 / 11
0
1
2
3
2
3
-2
4
algo
master
.
io
Step:
Track both the max and min running products, a negative number can flip the min into the max