B:
Ngl, I found it much harder.
Even tho I found very early that n^2,1,n^2-1,2,.., will form a continuous seq. I just filled it with the last row and column and tried to reuse soln of n-1 by rotating and mirroring the matrix.
Did all sorts of 🤡 things and got ac at 2nd last min.