← 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]?
- A.4
- B.6
- C.7
- 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 →