Last active
September 10, 2023 11:44
-
-
Save codeperfectplus/b3f4b2cfadacdd10977ee140c3111f48 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def diagonalDifference(arr): | |
| # Write your code here | |
| d1 = sum(arr[i][i] for i in range(n)) | |
| d2 = sum(arr[i][n-i-1] for i in range(n)) | |
| return abs(d1 - d2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment