Maximum Size Subarray Sum Equals K

Given an integer array nums and an integer k, find the maximum length of a contiguous subarray whose sum is exactly k. Return 0 if no such subarray exists.

Although no code is required in...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: