
전체 글
Describing the UI
UI 설명 React는 UI 렌더링을 위한 JavaScript 라이브러리이다. React를 사용하면 재사용 가능하고 중첩 가능한 구성 요소로 결합할 수 있다. JSX로 마크업 작성하기 일단 JSX에 대해 알아볼 필요가 있다. JSX는 HTML과 비슷하게 생겼지만, JavaScript를 확장한 문법이다. const name = 'Minjun Kim'; const element = Hello, {name} 위와 같이 HTML 태그로 이루어진 element 자체를 변수로 선언하여 할당할 수 있다. JSX의 중괄호 안에는 모든 JavaScript 표현식이 들어갈 수 있다. 따라서, 예를 들어 어떤 태그에 속성을 동적으로 추가하고 싶을 경우 JSX를 활용할 수 있다. 또 JSX를 활용함으로써 많은 속성을 넣게 되..

LeetCode / Graph / 417번 / Pacific Atlantic Water Flow / JS
Pacific Atlantic Water Flow - LeetCode Can you solve this real interview question? Pacific Atlantic Water Flow - There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges, and the Atlantic Ocean touches leetcode.com 각 칸에 있는 숫자는 그 땅의 높이라고 생각하면 된다. 따라서 그 칸에 있는 물은 현재 있는 칸의 높이보다 작거나 같..
LeetCode / Graph / 994번 / Rotting Oranges / JS
Rotting Oranges - LeetCode Can you solve this real interview question? Rotting Oranges - You are given an m x n grid where each cell can have one of three values: * 0 representing an empty cell, * 1 representing a fresh orange, or * 2 representing a rotten orange. Every minute, any leetcode.com m * n의 격자판이 주어지는데 다음과 같은 각 셀은 3가지 상태중 하나를 가진다 0: 빈 셀 1: 신선한 오렌지가 있는 셀 2: 썩은 오렌..
LeetCode / Binary Search Tree / 173번 / Binary Search Tree Iterator / JS
Binary Search Tree Iterator - LeetCode Can you solve this real interview question? Binary Search Tree Iterator - Implement the BSTIterator class that represents an iterator over the in-order traversal [https://en.wikipedia.org/wiki/Tree_traversal#In-order_(LNR)] of a binary search tree (BST): * leetcode.com 이진 탐색 트리를 전위순회를 하였을 때, 다음 노드를 반환하는 next()와 다음 노드가 존재하는지 반환하는 hasN..
LeetCode / Binary Search Tree / 230번 / Kth Smallest Element in a BST / JS
Kth Smallest Element in a BST - LeetCode Can you solve this real interview question? Kth Smallest Element in a BST - Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree. Example 1: [https://assets.leetco leetcode.com BST(Binary Search Tree) 에서 K번째로 작은 노드의 값을 반환하는 문제이다. /** * Definit..
LeetCode / Binary Search Tree / 108번 / Convert Sorted Array to Binary Search Tree / JS
Convert Sorted Array to Binary Search Tree - LeetCode Can you solve this real interview question? Convert Sorted Array to Binary Search Tree - Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree. Example 1: [https://assets.leetcod leetcode.com input으로 들어온 정렬된 배열을 이진 탐색 트리로 변환하는 문제이다. /** * Defini..