개발로그필름
[프로그래머스/JS] 약수 구하기 본문
728x90
반응형
SMALL
https://school.programmers.co.kr/learn/courses/30/lessons/120897
풀이
js
function solution(n) {
let result = []
let index = 1;
while (index <= n) {
if (n % index === 0) result.push(index)
index++
}
return result
}
반응형
LIST
'coding test > 프로그래머스' 카테고리의 다른 글
[프로그래머스/JS] 배열의 유사도 (0) | 2024.03.06 |
---|---|
[프로그래머스/JS] 가장 큰 수 찾기 (0) | 2024.03.05 |
[프로그래머스/JS] 한 번만 등장한 문자 (0) | 2024.03.01 |
[프로그래머스/JS] 인덱스 바꾸기 (0) | 2024.02.24 |
[프로그래머스/JS] 영어가 싫어요 (1) | 2024.02.16 |
Comments