반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 자바스크립트
- 알고리즘
- 소켓
- 타입스크립트
- HTTP
- 크롤링
- Crawling
- dp
- 타입 챌린지
- 쉬운 문제
- 프로그래머스
- javascript
- Node.js
- 그래프
- type challenge
- Nestjs
- socket
- Algorithm
- 프로그래머스 레벨 2
- dfs
- 가천대
- 레벨 1
- 문자열
- typescript
- BFS
- TCP
- 수학
- 백준
- ip
- HTTP 완벽 가이드
Archives
- Today
- Total
목록K번째 수 (1)
kakasoo

// 프로그래머스 level1 k번째 수 const solution = (array, commands) => new Array(commands.length).fill(0).map((el, i) => i + 1).map(el => array.slice(commands[el-1][0] - 1, commands[el-1][1]).sort((o1, o2) => o1 - o2)[commands[el-1][2] -1]); 이 때 내가 왜 이렇게 풀었는지 기억이 나지 않는다. 그냥 함수형 컨셉을 해보고 싶었던 모양이다. 당연히 저런 가독성 없는 코드를 평소에도 짜는 건 아니다. const solution = (array, commands) => { const answer = []; commands.forEach((l..
프로그래밍/알고리즘 풀이
2021. 6. 25. 16:45