Easy10 pts
Diagonal Difference
Given a square matrix, compute the absolute difference between the sums of its diagonals.
Input
Line 1: n. Next n lines: n space-separated integers per line.
Output
A single integer: |left_diag - right_diag|.
Sample
3 11 2 4 4 5 6 10 8 -12
Expected
15
Loading editor…
Output
No output yet. Run your code to see results.