🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Arrays & Hashing Quiz: all 8 questions

Arrays & Hashing Quiz · Question 7 of 8

What does Kadane's algorithm return for [-2, 1, -3, 4, -1, 2, 1, -5, 4]?

What does Kadane's algorithm return for [-2, 1, -3, 4, -1, 2, 1, -5, 4]?

  1. A.4
  2. B.6
  3. C.7
  4. D.10
Answer & explanation

Correct answer: 6

The best subarray is [4, -1, 2, 1] with sum 6.

Can you get the rest right without peeking?

Take the timed Arrays & Hashing Quiz quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →