Exercises/#127 Maximum Product Subarray
#127

Maximum Product Subarray

MediumπŸ“¦ Arrays
85 XP

Problem

Given an integer array, find the contiguous subarray that has the largest product.

Examples

Input: nums = [2,3,-2,4]
Output: 6 ([2,3])

Input: nums = [-2,0,-1]
Output: 0
arraydynamic-programming
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

127 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features