← Quiz: Testing AI Code: all 10 questions
Quiz: Testing AI Code · Question 3 of 10
What input type made the AI's max-subarray function wrong?
What input type made the AI's max-subarray function wrong?
- A.Lists with only positive numbers
- B.Lists where every number is negative
- C.Empty strings
- D.Very long lists
Answer & explanation
Correct answer: Lists where every number is negative
It returned 0 (an empty subarray) instead of the largest single negative number.
Can you get the rest right without peeking?
Take the timed Quiz: Testing AI Code quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →