This question evaluates array manipulation, cumulative-sum reasoning, and algorithmic complexity analysis for counting contiguous subarrays that equal a target value.

Given an integer array nums and an integer k, return the number of contiguous subarrays whose sum equals k. Provide an algorithm better than O(n^ 2), explain time and space complexity, and describe how your approach handles negative numbers, zeros, very large arrays, and integer overflow concerns.