Subarray sum equals k

0
Remix

Count the contiguous subarrays whose sum equals k; the array may contain negative numbers. Follow-ups: only report whether such a subarray exists, or return the longest one.

MetaCodingLast asked Aug 2026
No answer yet. Write the first one; the best answer gets endorsed.