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

Given a 0-indexed integer array nums, return the number of distinct quadruplets (a, b, c, d) such that:

nums[a] + nums[b] + nums[c] == nums[d], and
a < b < c < d

 
Please complete the following python code precisely:
```python
class Solution:
    def countQuadruplets(self, nums: List[int]) -> int:
```