작성
·
302
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)))
}
답변 3
0
0
0