Facebook News Feed analytics may represent each interaction as an integer score, including positive, negative, and zero values. Given an integer array nums and an integer k, return the length of the longest contiguous subarray whose elements sum exactly to k.
You must consider every contiguous subarray and may return 0 if no qualifying subarray exists.
nums, a list of integers, and k, an integer.k.def longest_subarray_sum_k(nums, k):