Largest Subarray With Sum K

Given an array of integers nums and an integer k, return the number of contiguous, non-empty subarrays whose elements sum to exactly k.

A subarray is a contiguous segment of the array.

Examples
Input: [[1,1,1],2]
Output: 2
Hints

Largest Subarray With Sum K

Given an array of integers `nums` and an integer `k`, return the **number** of contiguous, non-empty subarrays whose elements sum to exactly `k`.