Problem 152 · Medium

Maximum Product Subarray

Track both running max and min products since a negative min can become the new max.

Open the interactive visualisation