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 da28f73

Browse files
solve: 무작위로 K개의 수 뽑기
1 parent 37bb653 commit da28f73

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

‎Level0/PRO181858.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Solution 1
2+
function solution(arr, k) {
3+
const deduplicationArray = [...new Set(arr)];
4+
5+
return Array.from({ length: k }, (_, index) => deduplicationArray[index] ?? -1);
6+
}

‎README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@
317317

318318
### 2024년 01월
319319

320-
| 날짜 | 난이도 | 문제 | JS 풀이 |
321-
| :-------: | :-------: | :-----------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------: |
322-
| 24.01.01. | `Level 0` | [특이한 정렬](https://school.programmers.co.kr/learn/courses/30/lessons/120880) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO120880.js) |
320+
| 날짜 | 난이도 | 문제 | JS 풀이 |
321+
| :-------: | :-------: | :----------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------: |
322+
| 24.01.01. | `Level 0` | [특이한 정렬](https://school.programmers.co.kr/learn/courses/30/lessons/120880) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO120880.js) |
323+
| 24.01.02. | `Level 0` | [무작위로 K개의 수 뽑기](https://school.programmers.co.kr/learn/courses/30/lessons/181858) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181858.js) |

0 commit comments

Comments
(0)

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