Algorithm · Meta · Medium
This problem set contains two independent tasks. Task 1 The input consists of an integer array nums and a target sum k. Count the non-empty contiguous subarrays of nums whose sum equals k. The array values may be negative, zero, or positive. If nums is empty, the answer is 0. Example 1: Explanation: The qualifying subarrays are [2,5] at indices 0 to 1, [5,2] at indices 1 to 2, and [2,5] at indices 2 to 3. Example 2: Explanation: The qualifying subarrays are [1,-1], [1,-1,0],…
Checking your access…