A Meta Platforms News Feed analysis job represents consecutive metric changes as an integer array. Given nums and a target sum k, return the length of the longest contiguous subarray whose elements sum exactly to k.
Values may be positive, negative, or zero. Return 0 if no qualifying subarray exists.
Implement longest_subarray_sum_k(nums, k).
nums, a list of integers, and k, an integer.k.def longest_subarray_sum_k(nums, k):