전체 글
![[LeetCode] 623. Add One Row to Tree (Daily Question)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fb5sbIh%2FbtsGFm8AdC0%2FAAAAAAAAAAAAAAAAAAAAAH7Ps3UAwgSKzX7Lc59wGccAq2CKl4X9d4wzVdTTrmQG%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DmHt0lePQv3vsQJPCK8EwoylU8JU%253D)
[LeetCode] 623. Add One Row to Tree (Daily Question)
문제 Given the root of a binary tree and two integers val and depth, add a row of nodes with value val at the given depth depth. Note that the root node is at depth 1. The adding rule is: - Given the integer depth, for each not null tree node cur at the depth depth - 1, create two tree nodes with value val as cur's left subtree root and right subtree root. - cur's original left subtree should be t..
![[LeetCode] 129. Sum Root to Leaf Numbers (Daily Question)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FF9qHo%2FbtsGBcGpXsK%2FAAAAAAAAAAAAAAAAAAAAAN2rZxCZFqpXuxBNRlJpXK-3YeO5K4UBdCZIEEy1QTh0%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DnC2lCHmgOh9TCbhvEFWEsr2u88w%253D)
[LeetCode] 129. Sum Root to Leaf Numbers (Daily Question)
문제 You are given the root of a binary tree containing digits from 0 to 9 only. Each root-to-leaf path in the tree represents a number. - For example, the root-to-leaf path 1 -> 2 -> 3 represents the number 123. Return the total sum of all root-to-leaf numbers. Test cases are generated so that the answer will fit in a 32-bit integer. A leaf node is a node with no children. 이진트리가 주어졌을 때, leaf노드에서 ..
![[LeetCode] 404. Sum of Left Leaves (Daily Question)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FcNH34z%2FbtsGBOykyRS%2FAAAAAAAAAAAAAAAAAAAAANSq48XtXSryCPgGYcMMCLrquvUamNpD-r4bYj8tnMjt%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DhXqY1sSH5JKphL1tQP7zHQv1mUg%253D)
[LeetCode] 404. Sum of Left Leaves (Daily Question)
문제 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. 이진트리가 주어졌을 때, 왼쪽 leaf node의 값의 합을 구하는 문제이다. Example 1: Input: root = [3,9,20,null,null,15,7] Output: 24 Explanation: There are two left leaves in the binary tree, with values 9 and 15 respectively. Example 2: Input: root = [1] Outp..
![[LeetCode] 85. Maximal Rectangle (Daily Question)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FuzLig%2FbtsGCp5fcCZ%2FAAAAAAAAAAAAAAAAAAAAAMczjcOENujyLMyEvQMPN4G-qZj3xSLA3BVG-6s_h4M5%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DCbFQMKvhDgro178ntuq2UKH4uhU%253D)
[LeetCode] 85. Maximal Rectangle (Daily Question)
문제 Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. 0과 1로 이루어진 테이블이 주어졌을 때, 1로 만들 수 있는 가장 큰 사각형의 넓이를 구하는 문제이다. Example 1: Input: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]] Output: 6 Explanation: The maximal rectangle is shown in the above picture. Example 2: Input..
![[LeetCode] 42. Trapping Rain Water (Daily Question)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FccyHwq%2FbtsGw8jjqw5%2FAAAAAAAAAAAAAAAAAAAAAPB5bKpfKqvInIfLMybb45xl683PpsOOgsa7DF2o0rpI%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DC96Yt1%252B9LkcEQTcvcuwieB%252FQf%252FU%253D)
[LeetCode] 42. Trapping Rain Water (Daily Question)
문제 Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. 다양한 높이의 기둥들이 주어진다. 이 때 비가오게 된다면 차게 될 물의 양을 구하는 문제이다. Example 1: Input: height = [0,1,0,2,1,0,1,3,2,1,2,1] Output: 6 Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain w..
[LeetCode] 402. Remove K Digits (Daily Question)
문제 Given string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removing k digits from num. 숫자 문자열 num에서 k개의 digit(0-9)을 없애서 가장 작은 수를 만드는 문제이다. Example 1: Input: num = "1432219", k = 3 Output: "1219" Explanation: Remove the three digits 4, 3, and 2 to form the new number 1219 which is the smallest. Example 2: Input: num = "10200", k = 1 O..