We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
publicstaticvoidMain(string[]args){intn=Convert.ToInt32(Console.ReadLine());int[][]a=newint[n][];intresult=0;for(inta_i=0;a_i<n;a_i++){string[]a_temp=Console.ReadLine().Split(' ');a[a_i]=Array.ConvertAll(a_temp,Int32.Parse);}//Here is my codefor(inti=0;i<n;i++){result+=((a[i][i])-(a[i][n-1-i]));}Console.WriteLine(Math.Abs(result));}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
This was my solution: