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

Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell.
The distance between two adjacent cells is 1.
 
Please complete the following python code precisely:
```python
class Solution:
    def updateMatrix(self, mat: List[List[int]]) -> List[List[int]]:
```