Dsa
Prefix Sum
Hard
Consecutive Even Sum
Given an array of integers, find all contiguous subarrays whose sum is even. Print the number of such subarrays. The input starts with an integer N followed by N integers.
Example:
Input:
4
1 2 3 4
Output:
4
Key concepts
prefix_sumeven_odd
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now