give m x n matrix mat integer threshold return maximum sidelength square sum equal threshold return 0 square Example 1input mat 113243211324321132432 threshold 4Output 2explanation the maximum length square sum 4 2 shownexample 2input mat 2222222222222222222222222 threshold 1output 0 Constraintsm matlengthn matilength1 m n 3000 matij 1040 threshold 105