← Cognizant questions
CodingModerateReported in a candidate post, Nov 2025

Sum of Same Consecutive Numbers occurring k times

Filed under Cognizant

Given an array of integers and an integer k, find the sum of all elements that appear in consecutive sequences of exactly length k.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Cognizant questions

Collected from public candidate posts and coding forums. Updated Nov 2026.