Algorithm · ByteDance · Medium
Given an integer array and an integer target k, determine the minimum length of a contiguous subarray whose elements total exactly k. Return 0 when no such subarray can be found. Input: Integer array nums. Integer target k. Output: Return the size of the shortest subarray whose sum is exactly k. Example: Constraints: 1 <= nums.length <= 10^5 1 <= nums[i] <= 10^4 Example
Checking your access…