Available question text
Find the largest side length k of any k×k subgrid whose every row sum, every column sum, and both diagonal sums are equal (entries need not be distinct). With m,n ≤ 50 the core challenge is efficiently testing all candidate squares—typically by enumerating sizes/positions and using prefix sums to verify row, column and diagonal sums quickly.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1895. Largest Magic Square
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source