You are viewing a single comment's thread. Return to all comments →
JAVASCRIPT :D
let primary = 0; let secondary = 0; for(let i = 0; i < arr.length ; i++){ primary += arr[i][i]; secondary += arr[i][arr.length -1 -i] } 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 →
JAVASCRIPT :D