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

Given an integer array nums, return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i].
 
Please complete the following python code precisely:
```python
class Solution:
    def countSmaller(self, nums: List[int]) -> List[int]:
```