23.09.08 00:39 작성
·
291
0
const solution = (arr) => {
const resultArr = [
...arr,
...arr.map((_,location) => Array.from({length:arr.length}, (_,idx) => arr[idx][location])),
Array.from({length:arr.length}, (_, idx) => arr[idx][idx]),
Array.from({length:arr.length}, (_,idx) => arr[arr.length-idx-1][arr.length-idx-1])
]
return Math.max(...resultArr.map(list => list.reduce((pre, cur) => pre+cur, 0)))
}