
전체 글
Programmers / Level 1 / 옹알이 (2) / JS
프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function isPossible(babbling) { // 가능한 발음 리스트 const possibleList = ['aya', 'ye', 'woo', 'ma']; // 가능한 발음 리스트에 있는 발음이라면 해당 인덱스로 바꿔줌 possibleList.forEach((el, idx) => { babbling = babbling.replaceAll(el, idx); }); for (let i = 0; i < babbling.length; i += 1) { // 연속된 발음이라면 fal..
백준 / 이분 탐색 / 16401번 / 과자 나눠주기 / JS
16401번: 과자 나눠주기 첫째 줄에 조카의 수 M (1 ≤ M ≤ 1,000,000), 과자의 수 N (1 ≤ N ≤ 1,000,000)이 주어진다. 둘째 줄에 과자 N개의 길이 L1, L2, ..., LN이 공백으로 구분되어 주어진다. 과자의 길이는 (1 ≤ L1, L2, ..., LN ≤ 1, www.acmicpc.net /* 과자 나눠주기 */ const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : '../input.txt'; // const filePath = process.platform === 'linux' ? '/dev/stdin' : 'BOJ/input.txt';..
백준 / 그래프 - DFS / 13565번 / 침투 / JS
13565번: 침투 첫째 줄에는 격자의 크기를 나타내는 M (2 ≤ M ≤ 1,000) 과 N (2 ≤ N ≤ 1,000) 이 주어진다. M줄에 걸쳐서, N개의 0 또는 1 이 공백 없이 주어진다. 0은 전류가 잘 통하는 흰색, 1은 전류가 통하지 않 www.acmicpc.net const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : '../input.txt'; // const filePath = process.platform === 'linux' ? '/dev/stdin' : 'BOJ/input.txt'; const input = fs.readFileSync(filePath).t..
React & React-Dom
개요 아래와 같이 기본 index.js를 보면 'react'와 'react-dom/client'를 import 하는것을 볼 수 있다. 두개의 차이점은 무엇이고 굳이 'react'에서 'react-dom'을 분리한 이유는 무엇일까? import React from 'react'; import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render(); React 2022.10.11 - [React] - Why React? Why React? What is React? React는..
백준 / 그래프 - BFS / 1926번 / 그림 / JS
https://www.acmicpc.net/problem/1926 1926번: 그림 어떤 큰 도화지에 그림이 그려져 있을 때, 그 그림의 개수와, 그 그림 중 넓이가 가장 넓은 것의 넓이를 출력하여라. 단, 그림이라는 것은 1로 연결된 것을 한 그림이라고 정의하자. 가로나 세로 www.acmicpc.net const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : '../input.txt'; // const filePath = process.platform === 'linux' ? '/dev/stdin' : 'BOJ/input.txt'; const input = fs.readFileSync(filePath..
Programmers / Level 0 / 저주의 숫자 3 / JS
https://school.programmers.co.kr/learn/courses/30/lessons/120871 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr function solution(n) { let count = 0; let num = 0; while(count < n) { num += 1; // num이 3의 배수이거나 3이 들어가있지 않을때만 count += 1 if(!(num % 3 === 0 || String(num).includes('3'))) count += 1; } return num; }