NeetCode #111LC-560MediumArrays & HashingNC 250
← Back to All Problems

#111 · #560 · Subarray Sum Equals K(和为 K 的子数组)

📌 Problem Statement & Constraints

Given an array of integers nums and an integer k, return the total number of contiguous subarrays whose sum equals k. Constraints: 1 <= nums.length <= 2 * 10^4, -1000 <= nums[i] <= 1000, -10^7 <= k <= 10^7.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!