전체 글
CSR (Client Side Rendering)
CSR 이란? React를 사용한 CSR에서 브라우저는 페이지에 필요한 최소한의 HTML 페이지와 JavaScript를 다운로드한다. 그런 다음에 JavaScript를 사용해서 DOM을 업데이트하고 페이지를 렌더링한다. 애플리케이션이 처음 로드될 때, 즉 사용자가 페이지를 처음 로딩했을 때 사용자는 전체 페이지를 보기 전에 약간의 딜레이를 느낄 수 있다. 모든 JavaScript가 다운로드 및 실행이 될 때까지 페이지가 완전히 렌더링되지 않기 때문이다. 순서대로 나타내자면 다음과 같다. 사용자가 홈페이지를 최초로 접속했을 때 클라이언트는 이를 확인하고 서버로 요청한다. 서버는 빈 페이지(HTML, CSS)를 클라이언트에게 전달한다. (JavaScript에 대한 링크는 존재) 전달받은 클라이언트에서 해당 ..
Installation
Node.js 18.17이나 그 이상의 버전이 필요! 자동 설치 npx create-next-app@latest next 최신 버전으로 자동 설치! TypeScript, ESLint, Tailwind CSS 등 선택하여 자동으로 설치하게 할 수 있다. 수동 설치 npm install next@latest react@latest react-dom@latest 그 이후 package.json을 열어서 다음과 같이 설정해주면 된다. { "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" } } 위 스크립트는 개발의 여러 단계를 나타낸다. dev: next dev로 시작하면, 개발 모드에서..
LeetCode / Tree / 1161번 / Maximum Level Sum of a Binary Tree / JS
Maximum Level Sum of a Binary Tree - LeetCode Can you solve this real interview question? Maximum Level Sum of a Binary Tree - Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. Return the smallest level x such that the sum of all the values of node leetcode.com 트리에서 각 층을 이루는 노드들의 합을 구했을 때, 그 합이 가장 큰 층이 몇 층인지 반환하는 문제이다...
LeetCode / Tree / 530번 / Minimum Absolute Difference in BST / JS
Minimum Absolute Difference in BST - LeetCode Can you solve this real interview question? Minimum Absolute Difference in BST - Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree. Example 1: [https://assets.l leetcode.com BST(Binary Search Tree)를 이루는 모든 노드들 중에서 2개의 노드를 뽑아 뺐을 때, 가장 작..
LeetCode / Matrix / 2352번 / Equal Row and Column Pairs / JS
Equal Row and Column Pairs - LeetCode Can you solve this real interview question? Equal Row and Column Pairs - Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal. A row and column pair is considered equal if they contain th leetcode.com 각 행과 각 열을 모두 나누어서 봤을 때, 행과 열을 이루는 값들이 같으면 카운트를 하나 더해서 최종 카운트를 반환하는..
LeetCode / Array / 228번 / Summary Ranges / JS
Summary Ranges - LeetCode Can you solve this real interview question? Summary Ranges - You are given a sorted unique integer array nums. A range [a,b] is the set of all integers from a to b (inclusive). Return the smallest sorted list of ranges that cover all the numbers in the arr leetcode.com 연속수를 이루는 모든 범위를 배열에 담아서 반환한다. /** * @param {number[]} nums * @return {string[]..