Category : comparison

i got a problem while finishing this task. It is because while trying to finish with this algorithm, i got weird result. function main(arr) { let max; let sum; for(let a=0; a<arr.length-2; a++){ for(let b=0; b<arr.length-2; b++){ sum = arr[a][b] + arr[a][b+1] + arr[a][b+2] + arr[a+1][b+1] + arr[a+2][b] + arr[a+2][b+1] + arr[a+2][b+2]; console.log(sum); if(!max ..

Read more