Check all subarrays. For each starting index i and ending index j, compute the sum and check if it equals k.
There are O(n2) subarrays. Even with prefix sums (making each sum O(1)), the total is O(n2).
For n=2×104, that's 4×108 operations. Too slow.