You are viewing a single comment's thread. Return to all comments →
int finalFirst = 0; for (int i = 0; i < arr.size(); i++) { finalFirst += arr.get(i).get(i); } //System.out.println(finalFirst); int finalSecond = 0; for (int i = 0; i < arr.size(); i++) { finalSecond += arr.get(i).get((arr.size()-1)-i); } //System.out.println(finalSecond); //System.out.println(Math.abs(finalSecond-finalFirst)); return Math.abs(finalSecond-finalFirst);
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 →