You are viewing a single comment's thread. Return to all comments →
My solution is:
int maxSum = (-9) * 7; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { int tmp = arr[i + 1][j + 1]; for (int k = 0; k < 3; k++) { tmp += arr[i][j + k] + arr[i + 2][j + k]; } if (tmp >= maxSum) maxSum = tmp; } } cout << maxSum;
2D Array - DS
You are viewing a single comment's thread. Return to all comments →
My solution is: