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

You are given an integer array nums and two positive integers m and k.
Return the maximum sum out of all almost unique subarrays of length k of nums. If no such subarray exists, return 0.
A subarray of nums is almost unique if it contains at least m distinct elements.
A subarray is a contiguous non-empty sequence of elements within an array.
 
Please complete the following python code precisely:
```python
class Solution:
    def maxSum(self, nums: List[int], m: int, k: int) -> int:
```