반응형
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 | 29 | 30 | 31 |
Tags
- dp
- dfs
- socket
- type challenge
- 프로그래머스
- Crawling
- 소켓
- 백준
- 문자열
- 알고리즘
- typescript
- TCP
- HTTP
- Nestjs
- ip
- HTTP 완벽 가이드
- Algorithm
- 타입 챌린지
- 타입스크립트
- 크롤링
- 쉬운 문제
- BFS
- Node.js
- 가천대
- 그래프
- 레벨 1
- 프로그래머스 레벨 2
- 수학
- 자바스크립트
- javascript
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