https://school.programmers.co.kr/learn/courses/30/lessons/12905
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
function solution(board) {
return board.reduce((acc, rows, i, board) => {
if (rows.length <= 1) return 1;
if (!i) return acc;
rows.forEach((column, j) => {
if (!j) return;
if (column) {
board[i][j] = Math.min(board[i - 1][j - 1], board[i - 1][j], board[i][j - 1]) + 1;
acc = Math.max(acc, board[i][j]);
}
});
return i !== board.length - 1 ? acc : acc * acc;
}, 0);
}
GitHub - developeSHG/Algorithm-Baekjoon_Programmers: 백준 and 프로그래머스 소스코드
백준 and 프로그래머스 소스코드. Contribute to developeSHG/Algorithm-Baekjoon_Programmers development by creating an account on GitHub.
github.com
'Coding Test > Programmers' 카테고리의 다른 글
[Programmers] (Summer/Winter Coding(2019)) Lv 2. 멀쩡한 사각형 (0) | 2023.03.24 |
---|---|
[Programmers] (2021 카카오 채용연계형 인턴십) Lv 2. 거리두기 확인하기 (1) | 2023.03.23 |
[Programmers] (완전탐색) Lv 2. 전력망을 둘로 나누기 (0) | 2023.03.17 |
[Programmers] (Summer/Winter Coding(~2018)) Lv 2. 배달 (0) | 2023.03.16 |
[Programmers] (2021 Dev-Matching: 웹 백엔드 개발자(상반기)) Lv 2. 행렬 테두리 회전하기 (0) | 2023.03.15 |
댓글