프로그래머스 - 땅따먹기
part20. 땅따먹기
js ver 1.0
function solution(land) {
return Math.max(...land.reduce((result, score) => {
return score.map((num, step) => {
return num + Math.max(...result.filter((el, idx) => idx != step));
});
}, Array(land[0].length).fill(0)));
}