Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fb0b1d7

Browse files
solve: 순서쌍의 개수
1 parent 9e11a09 commit fb0b1d7

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

‎Level0/PRO120836.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Solution 1
2+
function solution(n) {
3+
const orderedPairList = [];
4+
5+
for (let i = 1; i <= n / i; i++) {
6+
const quotient = n / i;
7+
8+
if (Number.isInteger(quotient)) {
9+
orderedPairList.push([i, quotient]);
10+
11+
if (quotient !== i) {
12+
orderedPairList.push([quotient, i]);
13+
}
14+
}
15+
}
16+
17+
return orderedPairList.length;
18+
}

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,4 @@
295295
| 23.11.24. | `Level 0` | [콜라츠 수열 만들기](https://school.programmers.co.kr/learn/courses/30/lessons/181919) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181919.js) |
296296
| 23.11.25. | `Level 0` | [특별한 이차원 배열 2](https://school.programmers.co.kr/learn/courses/30/lessons/181831) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181831.js) |
297297
| 23.11.26. | `Level 0` | [삼각형의 완성조건 1](https://school.programmers.co.kr/learn/courses/30/lessons/120889) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO120889.js) |
298+
| 23.11.27. | `Level 0` | [순서쌍의 개수](https://school.programmers.co.kr/learn/courses/30/lessons/120836) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO120836.js) |

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /