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

// 프로그래머스 level1 시저 암호를 풀었습니다. function solution(s, n) { var answer = ""; let big = []; let small = []; for (let i = "A".charCodeAt(0); i big.length - 1) nextPos -= big.length; return big[nextPos]; } else if (small.includes(el)) { let nextPos = small.indexOf(el) + n; if (nextPos > small.length - 1) nextPos -= small.length; return small[nextPos]; } else return el; }); return s.join(""); }

const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(line); }); /** * * @param {string} line */ const main = (line) => { let small = 0; let big = 0; let num = 0; let space = 0; for (let i = 0; i < line.length; i++) { const cur = line[i]; if (!isNaN(cur - 0)) { if (cur === " ") { space++; } els..

const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { let answer = ""; for (let i = 0; i < line.length; i++) { answer += line[i]; if (answer.length === 10) { console.log(answer); answer = ""; } } console.log(answer); });

const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(line); rl.close(); }).on("close", () => { process.exit(); }); const findEmotion = (line, emotion) => { let count = 0; for (let i = 0; i < line.length - 3; i++) { if (line[i] === emotion[0]) { if (line[i + 1] === emotion[1]) { if (line[i + 2]..

// 백준 11365번 !밀비 급일을 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; rl.on("line", (line) => { if (line !== "END") { input.push(line); } else { main(); rl.close(); } }).on("close", () => { process.exit(); }); const main = () => { for (let i = 0; i < input.length; i++) { console.log(input[i].spl..

const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(line); process.exit(); }); /** * * @param {string} line */ const main = (line) => { const numbers = line.split(""); let answer = ""; numbers.forEach((str, i) => { const dex = parseInt(str, 8); let binary = dex.toString(2); while (i !== 0 && ..

// 백준 2145번 숫자놀이를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { if (line === "0") { rl.close(); } main(line); }).on("close", () => { process.exit(); }); /** * * @param {string} line */ const main = (line) => { let numbers = line.split(""); const sumOfString = (acc, cur) => { acc = Num..

const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(line); rl.close(); }).on("close", () => process.exit()); const reverseString = (el) => { let newString = ""; for (let i = el.length - 1; i >= 0; i--) { newString += el[i]; } return newString; }; /** * * @param {string} line */ const main = (..

형변환 JavaScript에서는 명시적인 형변환, 묵시적인 형변환이 있다. 엄밀히 말해, 묵시적인 형변환은 Wrapper 함수로 인한 형변환이라고 할 수 있겠다. 여기서는 둘의 구분 없이, 자주 보게되는 형태의 형변환들을 짚고 넘어가고자 한다. String String(1) === '1'; // true 1 + "" = '1' // true String으로 감싸서 문자열로 변경할 수도 있으며, 숫자에 문자열을 더해 변경할 수도 있다. Number Number('1') === 1 // true '1' - 0 === 1 // true +'1' === 1 // true '1' / 1 === 1 // true String과 마찬가지로 Number로 감싸서 숫자로 변경하는 것이 가능하고, 뺄셈이나 나눗셈으로도 가..