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

Given a (0-indexed) integer array nums and two integers low and high, return the number of nice pairs.
A nice pair is a pair (i, j) where 0 <= i < j < nums.length and low <= (nums[i] XOR nums[j]) <= high.
 
Please complete the following python code precisely:
```python
class Solution:
    def countPairs(self, nums: List[int], low: int, high: int) -> int:
```