---
title: "Discussion on \"Maximum Product Subarray\" | Hashnode"
description: "Discussion on \"Maximum Product Subarray\". link\nKey ideas\n\nWe want to have even or 0 negative numbers in the subarray, so that the product will be positive.\nThe challenge is we never know if we will eventually get even negative numbers, so we need to maintain 3 variables \n\nlocal_max: the maxi..."
url: "https://hashnode.com/posts/maximum-product-subarray/631cb0ebf73f4734bc054af1"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Maximum Product Subarray](https://brianhu.hashnode.dev/maximum-product-subarray?utm_source=hashnode&utm_medium=feed)

link Key ideas We want to have even or 0 negative numbers in the subarray, so that the product will be positive. The challenge is we never know if we will eventually get even negative numbers, so we need to maintain 3 variables local\_max: the maxi...

Sep 10, 2022 · 2 min read · brianhu.hashnode.dev  
Read the article

-   [#dynamic-programming](https://hashnode.com/tag/dynamic-programming)

## Written by

[Brian Hu](https://hashnode.com/@brianhu)

@brianhu

  
[View profile](https://hashnode.com/@brianhu)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
