Maximum Product Subarray — track max and min
A running product can swing wildly: a negative number turns the smallest product into the largest. So carry both the max and the min ending here, and swap roles as signs flip.
Try:
max ending here 0
min ending here 0
best overall 0