Given an array of integers (negative values allowed) and a target k, return the length of the longest contiguous subarray that sums to exactly k.
Example 1
Explanation: The subarray [1,-1,5,-2] (indices 0-3) sums to 3 and has length 4 — the longest qualifying subarray.
Example 2
Explanation: The subarray [-1,2] (indices 1-2) sums to 1; no longer subarray in this array also sums to 1.
Example 3
Explanation: No subarray sums to 100, so the answer is 0 — there is no 'no answer' sentinel here, since a length can never be negative.
Code execution is coming soon.