You are viewing a single comment's thread. Return to all comments →
int currSum=0, maxSum=Integer.MIN_VALUE; for(int i=0; i<arr.size()-2; i++){ for(int j=0; j<arr.size()-2; j++){ currSum = arr.get(i).get(j)+arr.get(i).get(j+1)+arr.get(i).get(j+2); currSum += arr.get(i+1).get(j+1); currSum += arr.get(i+2).get(j)+arr.get(i+2).get(j+1)+arr.get(i+2).get(j+2); maxSum = Math.max(currSum, maxSum); } currSum = 0; } System.out.println(maxSum);
Seems like cookies are disabled on this browser, please enable them to open this website
Day 11: 2D Arrays
You are viewing a single comment's thread. Return to all comments →