https://medium.com/@saikrupar82/understanding-the-solution-for-leetcode-problem-840-magic-squares-in-grid-34366355e5bd