문제이진 트리가 좌우 대칭인지 확인하는 문제이다. https://leetcode.com/problems/symmetric-tree/ Symmetric Tree - LeetCodeCan you solve this real interview question? Symmetric Tree - Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Example 1: [https://assets.leetcode.com/uploads/2021/02/19/symtree1.jpg] Input: rooleetcode.com 정답 및 풀이/** * Definition for a b..
전체 글
IT경영학과 & 컴퓨터공학과 재학 중문제한 번만 나타나는 문자를 찾아 제일 앞에 있는 원소의 인덱스를 반환하는 문제이다. https://leetcode.com/problems/first-unique-character-in-a-string/description/ First Unique Character in a String - LeetCodeCan you solve this real interview question? First Unique Character in a String - Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1. Example 1: Input: s = "lee..
문제왼쪽 리프 노드의 값을 모두 더해 반환하는 문제이다. https://leetcode.com/problems/sum-of-left-leaves/description/?envType=problem-list-v2&envId=tree Sum of Left Leaves - LeetCodeCan you solve this real interview question? Sum of Left Leaves - Given the root of a binary tree, return the sum of all left leaves. A leaf is a node with no children. A left leaf is a leaf that is the left child of another node. Example ..
문제리프노드가 나올 때 까지의 경로를 출력하는 문제이다. https://leetcode.com/problems/binary-tree-paths/description/?envType=problem-list-v2&envId=tree Binary Tree Paths - LeetCodeCan you solve this real interview question? Binary Tree Paths - Given the root of a binary tree, return all root-to-leaf paths in any order. A leaf is a node with no children. Example 1: [https://assets.leetcode.com/uploads/2021/03/12/paths..
문제트리를 반전시키는 문제이다. https://leetcode.com/problems/invert-binary-tree/?envType=problem-list-v2&envId=tree Invert Binary Tree - LeetCodeCan you solve this real interview question? Invert Binary Tree - Given the root of a binary tree, invert the tree, and return its root. Example 1: [https://assets.leetcode.com/uploads/2021/03/14/invert1-tree.jpg] Input: root = [4,2,7,1,3,6,9] Output: [4leetcode.co..
문제루트부터 리프 노드까지의 경로 합이 targetSum과 일치하는지 확인하는 문제이다. https://leetcode.com/problems/path-sum/description/?envType=problem-list-v2&envId=tree Path Sum - LeetCodeCan you solve this real interview question? Path Sum - Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum. A leaf is a n..
문제트리의 최소 깊이를 세는 문제이다. https://leetcode.com/problems/minimum-depth-of-binary-tree/description/?envType=problem-list-v2&envId=tree Minimum Depth of Binary Tree - LeetCodeCan you solve this real interview question? Minimum Depth of Binary Tree - Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf n..
문제트리가 Balanced Binary Tree(height-balanced)인지 판별하는 문제이다. https://leetcode.com/problems/balanced-binary-tree/description/?envType=problem-list-v2&envId=tree Balanced Binary Tree - LeetCodeCan you solve this real interview question? Balanced Binary Tree - Given a binary tree, determine if it is height-balanced. Example 1: [https://assets.leetcode.com/uploads/2020/10/06/balance_1.jpg] Input: root..