반응형
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
- ip
- javascript
- BFS
- 소켓
- Node.js
- 타입스크립트
- TCP
- 크롤링
- HTTP 완벽 가이드
- 백준
- HTTP
- Crawling
- 수학
- typescript
- Nestjs
- 그래프
- 자바스크립트
- 가천대
- 알고리즘
- 문자열
- dp
- type challenge
- 타입 챌린지
- 레벨 1
- 프로그래머스 레벨 2
- socket
- 쉬운 문제
- 프로그래머스
- dfs
- Algorithm
Archives
- Today
- Total
목록두 개 뽑아서 더하기 (2)
kakasoo

// 프로그래머스 level2 기능 개발을 풀었습니다. const split = (arr) => { let answer = []; let count = 1; for (let i = 0; i { arr.push(Math.ceil((100 - program) / spee..
프로그래밍/알고리즘 풀이
2021. 6. 26. 12:45

// 프로그래머스 level2 두 개 뽑아서 더하기 function solution(numbers) { let answer = []; numbers.map((el1, i) => { numbers.map((el2, j) => { if ((i !== j) && (!answer.includes(el1+el2))) answer.push(el1 + el2); }) }) return answer.sort((o1,o2) => o1 - o2); } for문 두 개로 하여 인덱스가 다른 두 값을 더한 것을 계속 더해 간다. 중복을 제거하면서 더한 후 정렬해서 내보내기만 하면 된다. 레벨 2가 맞던가 싶다. 너무 오래 전에 풀어서 기억이 가물가물하다.
프로그래밍/알고리즘 풀이
2021. 6. 26. 12:44