일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 프로그래머스
- 문자열
- Crawling
- socket
- 프로그래머스 레벨 2
- Node.js
- 수학
- BFS
- 레벨 1
- 백준
- TCP
- type challenge
- javascript
- dp
- 소켓
- 크롤링
- typescript
- HTTP
- 쉬운 문제
- 타입 챌린지
- ip
- Nestjs
- 가천대
- 알고리즘
- 타입스크립트
- 자바스크립트
- 그래프
- dfs
- Algorithm
- HTTP 완벽 가이드
- Today
- Total
목록자료구조 (4)
kakasoo

// 프로그래머스 level1 2016년 문제를 풀었습니다. function getDays(month) { switch (month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31; case 2: return 29; default: return 30; } } function whatDay(answer) { if (answer === 0) return 'FRI'; if (answer === 1) return 'SAT'; if (answer === 2) return 'SUN'; if (answer === 3) return 'MON'; if (answer === 4) retu..

const checkDoll = (stack, curCount) => { stack.some((el, i) => { if(stack[i] === stack[i+1]) { stack.pop(); stack.pop(); curCount += 2; } }) return curCount; } const solution = (board, moves) => { let answer = 0; let stack = []; moves.map((el) => { board.some((row, height) => { if(row[el -1] != 0) { stack.push(row[el -1]); answer = checkDoll(stack, answer); row[el -1] = 0; return true; } }); });..

const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(line); }).on("close", () => process.exit()); /** * * @param {string} line */ const main = (line) => { const [N, K] = line.split(" ").map(Number); const arr = new Array(N).fill(0).map((el, i) => i + 1); let answer = "

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 #include #include using namespace std; /* push X : 정수 X를 스택에 넣는 연산이다. pop : 스택에서 가장 위에 있는 정수를 빼고, 그 수를 출력한다. 만약 스택에 들어있는 정수가 ..