https://school.programmers.co.kr/learn/courses/30/lessons/42842
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
javascript
닫기function solution(brown, yellow) {
var answer = [];
const SUM = brown + yellow;
for (height = 3; height <= SUM / 2; ++height) {
let width = Math.floor(SUM / height);
if ((width - 2) * (height - 2) === yellow) return [width, height];
}
return answer;
}
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] Lv 2. 멀리 뛰기 (0) | 2023.02.01 |
---|---|
[Programmers] Lv 2. N개의 최소공배수 (0) | 2023.01.30 |
[Programmers] (Summer/Winter Coding(~2018)) Lv 2. 영어 끝말잇기 (0) | 2023.01.27 |
[Programmers Test] (2회차 코딩테스트) No 5. WordTrain (0) | 2023.01.27 |
[Programmers Test] (2회차 코딩테스트) No 4. palindrome (0) | 2023.01.27 |
댓글