โ† Amazon questions
CodingMediumReported in a candidate post, Aug 2026

Count subarrays whose sum equals K

Filed under Amazon

Given an integer array nums and an integer k, return the total number of contiguous subarrays whose elements sum to exactly k. The array may contain negative numbers and zeros.

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 Amazon questions

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