Skip to content

Commit de1eea3

Browse files
committed
add remove for max product subarray
1 parent 1684ab3 commit de1eea3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

maximum-product-subarray/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Yet another [Maximum Subarray](../maximum-subarray)
2+
3+
We cannot just drop negative histories this time, instead,
4+
They may grow into bigger positive numbers in the future.
5+
6+
To make [Maximum Subarray](../maximum-subarray) works on this problem,
7+
just add a variable to remember the negative histories.
8+
9+
10+
When a negative number comes,
11+
the negative history may trun into a number greater than positive history.
12+
Swap the positive and negative histories.

0 commit comments

Comments
 (0)