You are viewing a single comment's thread. Return to all comments →
let maxCount = Number.NEGATIVE_INFINITY; // JS Solution let r = 0; let c = 0; while(r+2 < a.length) { while(c+2 < a.length) { const pSum = a[r][c] + a[r][c+1] + a[r][c+2] + a[r+1][c+1] + a[r+2][c] + a[r+2][c+1] + a[r+2][c+2]; maxCount = Math.max(maxCount, pSum); c++; } r++; c=0; } return maxCount;
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 →