Your question is Longest Subarray Sum Equals K. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an array of integers nums and an integer k, return the length of the longest contiguous subarray whose elements sum to k.
If no such subarray exists, return 0.
nums: a list of integersk: an integer target sumkdef longest_subarray_sum_k(nums, k):