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

Given an integer array nums and an integer k, return the number of good subarrays of nums.
A good array is an array where the number of different integers in that array is exactly k.

For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3.

A subarray is a contiguous part of an array.
 
Please complete the following python code precisely:
```python
class Solution:
    def subarraysWithKDistinct(self, nums: List[int], k: int) -> int:
```