Available question text
Find the length of the longest contiguous subarray whose elements sum to k. Because the array can contain negatives (so two-pointer sliding window fails), this is typically solved in O(n) using prefix sums and a hashmap to record earliest prefix-sum indices.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Goldman Sachs
Leetcode 325. Maximum Size Subarray Sum Equals k
Reported Apr 6, 2026 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source