Sponsored
Use these hints if you're stuck. Try solving on your own first.
There will be overlap of elements in the primary and secondary diagonals if and only if the length of the matrix is odd, which is at the center.
Solve with full IDE support and test cases