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

A k x k magic square is a k x k grid filled with integers such that every row sum, every column sum, and both diagonal sums are all equal. The integers in the magic square do not have to be distinct. Every 1 x 1 grid is trivially a magic square.
Given an m x n integer grid, return the size (i.e., the side length k) of the largest magic square that can be found within this grid.
 
Please complete the following python code precisely:
```python
class Solution:
    def largestMagicSquare(self, grid: List[List[int]]) -> int:
```