본문 바로가기
반응형

전체 글167

[LeetCode 해석 및 풀이] 78. Subsets(하위 집합) LeetCode 문제 해석 및 풀이 방법문제 78. Subsets(하위 집합)난이도 : 중간🟡 바로가기 문제 설명영문Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order. 한글서로 다른 요소들의 nums 정수 배열이 주어지면 가능한 모든 하위 집합(멱집합) 을 반환합니다. 해답 세트에는 중복된 하위 세트가 포함되어서는 안 됩니다. 어떤 순서로든 해답을 반환할 수 있습니다. 제한조건1 -10 All the numbers of nums are .. 2024. 7. 28.
[LeetCode 해석 및 풀이] 105. Construct Binary Tree from Preorder and Inorder Traversal(선위, 중위 순회에서 이진 트리 구성) LeetCode 문제 해석 및 풀이 방법문제 105. Construct Binary Tree from Preorder and Inorder Traversal(선위, 중위 순회에서 이진 트리 구성)난이도 : 중간🟡 바로가기 문제 설명영문Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree. 한글 이진 트리의 선위 순회인 preorder 와 동일한 트리의 중위 순회인 inorder, 두 개의 정수 배열이 주어질 때.. 2024. 7. 28.
[LeetCode 해석 및 풀이] 230. Kth Smallest Element in a BST(BST의 K번째로 작은 요소) LeetCode 문제 해석 및 풀이 방법문제 230. Kth Smallest Element in a BST(BST의 K번째로 작은 요소)난이도 : 중간🟡 바로가기 문제 설명영문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. Follow up: If the BST is modified often (i.e., we can do insert and delete operations) and you need to find the kth smallest frequently, how would you opti.. 2024. 7. 28.
[LeetCode 해석 및 풀이] 98. Validate Binary Search Tree(이진 검색 트리 검증) LeetCode 문제 해석 및 풀이 방법문제 98. Validate Binary Search Tree(이진 검색 트리 검증)난이도 : 중간🟡 바로가기 문 제 설명영문Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node's key.The right subtree of a node contains only nodes with keys greater than the node's key.Both the left and.. 2024. 7. 27.
[LeetCode 해석 및 풀이] 1448. Count Good Nodes in Binary Tree(이진 트리에서 좋은 노드 계산) LeetCode 문제 해석 및 풀이 방법문제 1448. Count Good Nodes in Binary Tree(이진 트리에서 좋 노드 계산)난이도 : 중간🟡 바로가기 문제 설명영문Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X. Return the number of good nodes in the binary tree. 한글이진 트리 root 주어질 때, 루트에서 X 까지의 경로에 X 보다 큰 값을 가진 노드가 없으면 트리의 노드 X 는 good 으로 명명됩니다. 이진 트리의 좋은 노드 수를 반환합니다. .. 2024. 7. 25.
[LeetCode 해석 및 풀이] 199. Binary Tree Right Side View(이진 트리 오른쪽 보기) LeetCode 문제 해석 및 풀이 방법문제 199. Binary Tree Right Side View(이진 트리 오른쪽 보기)난이도 : 중간🟡 바로가기 문제 설명영문Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. 한글이진 트리의 root 주어지면 자신이 그 오른쪽에 서 있다고 상상하고 위에서 아래로 정렬된 노드 값을 반환합니다. 제한조건The number of nodes in the tree is in the range [0, 100].-100  입출력 예입력출력root = .. 2024. 7. 25.
반응형