Pendo interview question

Even Subarray. Question on hackerrank Medium Difficulty