Last active
September 10, 2023 11:44
-
-
Save codeperfectplus/a72681b73fdb76eb07e76328487ff5ed 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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| string ltrim(const string &); | |
| string rtrim(const string &); | |
| vector<string> split(const string &); | |
| int diagonalDifference(vector<vector<int>> arr) { | |
| int s1 = 0; | |
| int s2 = 0; | |
| int n = arr.size(); | |
| for(int i=0;i<n;i++) { | |
| s1 += arr[i][i]; | |
| s2 += arr[i][n-i-1]; | |
| } | |
| return abs(s1 - s2); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment