Medium · Dynamic programming

Maximum Product Subarray

You are given a list of integers. Return the largest product of any run of numbers that sit next to each other.

  • The run has at least one number.
  • Numbers can be negative, zero or positive.
  • The answer fits in an ordinary integer.
nums = [2, 3, -2, 4]

→ 6   (2 × 3)
Record your take

No one has solved it yet.