Concept Flow - Maximum Product Subarray
Start at index 0
Initialize maxProd, minProd, result
For each element i in array
Calculate temp max and min products
Update maxProd and minProd
Update result if maxProd > result
Move to next element
End of array?
No→Repeat
Yes
Return result
We move through the array, keeping track of the maximum and minimum products ending at each position, updating the overall maximum product found.
