Please solve the programming task below using a self-contained code snippet in a markdown code block.

Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k.
A subarray is a contiguous non-empty sequence of elements within an array.
 
Please complete the following python code precisely:
```python
class Solution:
    def subarraySum(self, nums: List[int], k: int) -> int:
```