Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Clear & Modern solution in Clear category for [old] Weak Point by MaxGraey
function weakPoint(m) {
const n = m.length
const rows = new Array(n)
const cols = new Array(n)
for (let j = 0; j < n; j++) {
let row = 0, col = 0
for (let i = 0; i < n; i++) {
row += m[j][i]
col += m[i][j]
}
rows[j] = row
cols[j] = col
}
return [
rows.indexOf(Math.min(...rows)),
cols.indexOf(Math.min(...cols))
]
}
May 11, 2019
Comments: