전체 글
LeetCode / Array / 661번 / Image Smoother / JS
Image Smoother - LeetCode Can you solve this real interview question? Image Smoother - An image smoother is a filter of the size 3 x 3 that can be applied to each cell of an image by rounding down the average of the cell and the eight surrounding cells (i.e., the average of the nin leetcode.com 이미지에 3*3의 필터를 씌워서 부드럽게 만드는 문제이다. 예를 들어 (i, j)의 셀을 부드럽게 만드려면, (i, j)를 중심으로 3*3의..
백준 / 그래프 / 1697번 / 숨바꼭질 / JS
1697번: 숨바꼭질 수빈이는 동생과 숨바꼭질을 하고 있다. 수빈이는 현재 점 N(0 ≤ N ≤ 100,000)에 있고, 동생은 점 K(0 ≤ K ≤ 100,000)에 있다. 수빈이는 걷거나 순간이동을 할 수 있다. 만약, 수빈이의 위치가 X일 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).toStr..
백준 / 그래프 / 14226번 / 이모티콘 / JS
14226번: 이모티콘 영선이는 매우 기쁘기 때문에, 효빈이에게 스마일 이모티콘을 S개 보내려고 한다. 영선이는 이미 화면에 이모티콘 1개를 입력했다. 이제, 다음과 같은 3가지 연산만 사용해서 이모티콘을 S개 만 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).toString().trim().spli..
Routing
라우팅 기초 용어 Tree: 계층구조를 보여주는 컨벤션이다. 예를 들어, 부모와 자식 컴포넌트가 있는 컴포넌트 트리, 폴더 구조 등이 있다. Subtree: 트리의 일부이다. Root: 루트 레이아웃과 같은 트리나 서브트리의 가장 첫번째 노드이다. Leaf: URL 경로의 마지막 부분 같은 자식이 없는 서브트리의 노드이다. URL Segment: 슬래시(/)로 구분지어지는 URL 경로의 부분이다. URL Path: 도메인 뒤에 오는 URL의 부분이다. 폴더와 파일의 역할 폴더는 라우트를 정의하는데 사용된다. 파일은 라우트 세그먼트에 보여지는 UI를 만드는데 사용된다. 파일 컨벤션 Next.js는 중첩 라우트에서 특정 행동을 하는 UI를 만들기 위한 특별한 파일 세트를 제공한다. layout: 세그먼트와 ..
백준 / 정렬 / 8979번 / 올림픽 / JS
8979번: 올림픽 입력의 첫 줄은 국가의 수 N(1 ≤ N ≤ 1,000)과 등수를 알고 싶은 국가 K(1 ≤ K ≤ N)가 빈칸을 사이에 두고 주어진다. 각 국가는 1부터 N 사이의 정수로 표현된다. 이후 N개의 각 줄에는 차례대로 각 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).toString..
LeetCode / Array / 1582번 / Special Positions in a Binary Matrix / JS
Special Positions in a Binary Matrix - LeetCode Can you solve this real interview question? Special Positions in a Binary Matrix - Given an m x n binary matrix mat, return the number of special positions in mat. A position (i, j) is called special if mat[i][j] == 1 and all other elements in row i and co leetcode.com 2차원 배열에서 (i, j)의 값이 1이라면, 같은 행과 같은 열에 1이 (i, j)에만 존재했을 때..