Software Engineer's Blog

Blog posts — page 20

152. Maximum Product Subarray

Coding Interview

152. Maximum Product Subarray

Jason Yang · 01 Dec, 2025

Maximum Product Subarray (LeetCode 152): why you track max and min together to handle negatives and zeros, and the O(n) dynamic-programming solution.