🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Kadane's Algorithm: all 13 questions

Quiz: Kadane's Algorithm · Question 6 of 13

Why does the maximum PRODUCT subarray track the smallest product as well?

Why does the maximum PRODUCT subarray track the smallest product as well?

  1. A.To handle zeros only
  2. B.A very negative product times a negative number can become the largest product
  3. C.To make the code stable
  4. D.It doesn't need to
Answer & explanation

Correct answer: A very negative product times a negative number can become the largest product

For [−2, 3, −4], the product −6 becomes 24 when multiplied by −4.

Can you get the rest right without peeking?

Take the timed Quiz: Kadane's Algorithm quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →