• + 0 comments

    My solution is:

    int max = -100; for (int x=0;x<4;x++){ for (int y=0;y<4;y++){ int sum = 0; sum += arr.get(x).get(y); sum += arr.get(x).get(y+1); sum += arr.get(x).get(y+2); sum += arr.get(x+1).get(y+1); sum += arr.get(x+2).get(y); sum += arr.get(x+2).get(y+1); sum += arr.get(x+2).get(y+2); if (sum > max) max = sum;
    } } System.out.println(max);