You are viewing a single comment's thread. Return to all comments →
let primary = 0; let secondary = 0; let count = 0; for(let i=0;i < arr.length;++i){ primary += arr[i][count]; secondary += arr[i][(arr.length-1)-count]; ++count; } return Math.abs(primary-secondary);
Seems like cookies are disabled on this browser, please enable them to open this website
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →