You are viewing a single comment's thread. Return to all comments →
this is my solution :
**My Code In Java: **
int temporary = Integer.MIN_VALUE; for( int i = 0; i < arr.size() - 2; i++){ for( int j = 0 ; j < arr.size() - 2; j++){ int a = arr.get(i).get(j); int b = arr.get(i).get(j+1); int c = arr.get(i).get(j+2); int d = arr.get(i+1).get(j+1); int e = arr.get(i+2).get(j); int f = arr.get(i+2).get(j+1); int g = arr.get(i+2).get(j+2); int result = a + b + c + d + e + f + g; if (result > temporary){ temporary = result; } } } return temporary;
Seems like cookies are disabled on this browser, please enable them to open this website
2D Array - DS
You are viewing a single comment's thread. Return to all comments →
this is my solution :
**My Code In Java: **