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