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. A continuous subarray is called nice if there are k odd numbers on it.
Return the number of nice sub-arrays.
 
Please complete the following python code precisely:
```python
class Solution:
    def numberOfSubarrays(self, nums: List[int], k: int) -> int:
```