https://school.programmers.co.kr/learn/courses/30/lessons/12943
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
javascript
닫기const solution = (num) => collatz(num, (acc = 0));
const collatz = (num, acc) =>
num === 1 ? (acc >= 500 ? -1 : acc) : collatz(cal(num), ++acc);
const cal = (num) => (num % 2 ? num * 3 + 1 : num / 2);
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.01.18 |
---|---|
[Programmers] (탐욕법[Greedy]) Lv 2. 구명보트 (0) | 2023.01.17 |
[Programmers] Lv 2. 귤 고르기 (0) | 2023.01.16 |
[Programmers] Lv 1. 과일 장수 (0) | 2023.01.16 |
[Programmers] Lv 1. 기사단원의 무기 (0) | 2023.01.15 |
댓글