← All problemsSign in

Even Sum Subarray

CodeChefRating 1079Open on judge ↗

Given an array $A$ of size $N$, find the size of the largest subarray of $A$ which has an **even sum**. For example, for the array $[2, 1, 2]$ the answer is just $1$ as the largest subarray with an even sum is $[2]$. Note that a subarray is a contiguous part of an array. For the array $[1, 3, 2]$, some possible subarrays are $[1], [2], [1,3], [1,3,2]$. However, $[1,2]$ is not a subarray for t

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start