Diagonal Difference - HackerRank
Diagonal Difference - HackerRank
2 int main(){
For example, the square matrix is shown below:
3
4 int i,j,n;
1 2 3 5 scanf("%d",&n);
4 5 6 6 int a[n][n];
9 8 9 7 for(i=0;i<n;i++){
You have successfully solved Diagonal 8 Difference
for(j=0;j<n;j++){
Share Tweet
9 scanf("%d",&a[i][j]);
You
The left-to-right diagonal = are now 49 points away
. The right to leftfrom the 2nd
10 star for }} your problem solving badge.
Submissions
of space-separated integers .
Constraints Congratulations
You solved this challenge. Would you like to Next Challenge
challenge your friends?
Output Format
Editorial