Pergunta de entrevista da empresa Pendo

Even Subarray. Question on hackerrank Medium Difficulty