MCPcopy Index your code
hub / github.com/TheAlgorithms/Rust / subarray_sum_equals_k

Function subarray_sum_equals_k

src/general/subarray_sum_equals_k.rs:19–38  ·  view source on GitHub ↗

Counts the number of contiguous subarrays that sum to exactly k. # Parameters - `nums`: A slice of integers - `k`: The target sum # Returns The number of contiguous subarrays with sum equal to k. # Complexity - Time: O(n) - Space: O(n)

(nums: &[i32], k: i32)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 2

insertMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected