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

Given an array of positive integers nums, remove the smallest subarray (possibly empty) such that the sum of the remaining elements is divisible by p. It is not allowed to remove the whole array.
Return the length of the smallest subarray that you need to remove, or -1 if it's impossible.
A subarray is defined as a contiguous block of elements in the array.
 
Please complete the following python code precisely:
```python
class Solution:
    def minSubarray(self, nums: List[int], p: int) -> int:
```