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

Given a m x n matrix mat and an integer threshold, return the maximum side-length of a square with a sum less than or equal to threshold or return 0 if there is no such square.
 
Please complete the following python code precisely:
```python
class Solution:
    def maxSideLength(self, mat: List[List[int]], threshold: int) -> int:
```