목록전체 글 (298)
\(@^0^@)/

🐱👓 1. 문제 : 10809 https://www.acmicpc.net/problem/10809 🔥 2. 코드 및 풀이 const fs = require('fs'); const file = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(file).toString().split('\n'); let str = input[0]; const result = []; // 아스키 코드에서 a-z는 97-122까지 97-122의 범위를 돌면서, // String.fromCharCode => 메서드를 사용해서 a-z까지의 알파벳을 생성, // str.indexOf => 배열에 해당 값이 있다면 그 값의 ..

🐱👓 1. 문제 : 11654 https://www.acmicpc.net/problem/11654 🔥 2. 코드 const fs = require('fs'); const file = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(file).toString().split('\n'); let str = input[0]; console.log(str.charCodeAt(0)); 정말 오랜만에 자신 있게 후다닥 풀 수 있는 문제였다 :) 코테에 이런 것만 나온다면 자신감 빵빵하게 잘 풀 수 있을 텐데ㅠ 다른 사람도 다 푸는게 함정 아스키코드에 대해 조금 정리하고 넘어가 보자! 🤔 아스키 코드란? A..

🐱👓 1. 문제 : 4673 https://www.acmicpc.net/problem/4673 🔥 2. 풀이 + 코드 // 입력받는 값 없음 // 셀프넘버 : 생성자가 없는 수 // 33은 39의 생성자, 39는 51의 생성자, 51은 57의 생성자 // 33 => 33 + 3 + 3 = 39 => 39 + 3 + 9 + = 51 => 51 + 5 + 1 = 57 // 101은 생성자가 2개 (91과 100) // 91 => 91 + 9 + 1 = 101 , 100 => 100 + 1 + 0 + 0 = 101 // 0. 각 자리수를 더하는 함수를 만든다. // 1. 10,000개의 false를 가진 배열을 만들어서 // 2. 생성자를 갖는 숫자들을 true로 변경해준다. // 3. 그리고, 배열을 돌면..