일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 타입스크립트
- bfs
- group by
- level3
- 소프티어
- 브루트포스
- Lv. 0
- SQL 고득점 KIT
- 프로그래머스
- level 3
- programmers
- Lv. 2
- DP
- Java
- 너비 우선 탐색
- Dynamic Programming
- Lv. 3
- 파이썬
- softeer
- javascript
- 다이나믹프로그래밍
- Python
- 자바스크립트
- Stack
- 스택
- dfs
- C언어
- Lv. 1
- 문자열
- Typescript
- Today
- Total
목록sort (2)
몸과 마음이 건전한 SW 개발자
문제 링크 https://school.programmers.co.kr/learn/courses/30/lessons/181188 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 기존 코드 function solution(targets) { let answer = 0; targets.sort(([s1, e1], [s2, e2]) => (e1 - e2) || (s1 - s2)); let [start, end] = [0, 0]; targets.forEach(([s, e]) => { if (s >= end) { end = e; answer += 1 } }) retu..
sort() : 사전순 const tc1 = [1, 5, 10, 3, 11] const tc2 = ["D", "A", "b", "z", "a"] const tc3 = [2, 10, 1, "A", "b"] const tc4 = ["AB", "A", "BC", "B", "AAAAA"] console.log(tc1.sort()) // [ 1, 10, 11, 3, 5 ] console.log(tc2.sort()) // [ 'A', 'D', 'a', 'b', 'z' ] console.log(tc3.sort()) // [ 1, 10, 2, 'A', 'b' ] console.log(tc4.sort()) // [ 'A', 'AAAAA', 'AB', 'B', 'BC' ] sort((a, b) => a - b) : 오름차..