Skip to main content

Checkpoint: The Even-Pair Harvest

Challenge on lesson: Checkpoint — Bank the Bands

CHALLENGE
Difficulty: advanced+25 XP

**Task.** Count pairs (i, j), i < j, with a_i + a_j even. **Scoring bands (this checkpoint grades all of them):** - Band A (test 1–2): all a_i even, n ≤ 2000. - Band B (test 3–4): n ≤ 2000, arbitrary values. - Band C (test 5): n ≤ 200000, a_i < 10^9. **Hint-free budget:** the answer only needs the counts of even and odd values — but an O(n²) sweep still passes band B honestly.

Back to lesson: Checkpoint — Bank the Bands