목록2024/02 (26)
넘치게 채우기
https://leetcode.com/problems/even-odd-tree/description/ LeetCode - Even Odd Tree 문제 유형 : 이진트리 문제 난이도 : Medium 문제 A binary tree is named Even-Odd if it meets the following conditions: The root of the binary tree is at level index 0, its children are at level index 1, their children are at level index 2, etc. For every even-indexed level, all nodes at the level have odd integer values in strictly..
https://leetcode.com/problems/find-bottom-left-tree-value/description/ Leetcode - Find Bottom Left Tree Value 문제 유형 : 트리, dfs, 재귀 문제 난이도 : Medium 문제 Given the root of a binary tree, return the leftmost value in the last row of the tree. 이진 트리의 루트가 주어진다. 트리의 마지막 행의 가장 왼쪽 값을 반환하시오. 풀이 dfs를 하면서, 각 노드의 왼쪽, 오른쪽별로 더 깊이 있는 노드를 재귀적으로 반환하면 된다. 의 형태로 값을 반환시킨다. 같은 깊이라면, 더 왼쪽의 노드를 상위 노드에 반환한다. 코드 C++ /** * ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/ymT90/btsFkIk56VE/ShvG4rDKRHoWzziLKpwIXK/img.png)
https://leetcode.com/problems/diameter-of-binary-tree/description/ Diameter of Binary Tree - LeetCode Can you solve this real interview question? Diameter of Binary Tree - Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path leetcode.com Leetcode - Diameter of Bin..
https://leetcode.com/problems/same-tree/description/ Same Tree - LeetCode Can you solve this real interview question? Same Tree - Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the leetcode.com LeetCode - Same Tree 문제 유형 : 트리, 탐색 문제 난이도 : Easy 문제 Gi..
https://leetcode.com/problems/cheapest-flights-within-k-stops/description/ Cheapest Flights Within K Stops - LeetCode Can you solve this real interview question? Cheapest Flights Within K Stops - There are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is a flight from city fromi to leetcode.com LeetCode -..
https://leetcode.com/problems/find-the-town-judge/description/ Find the Town Judge - LeetCode Can you solve this real interview question? Find the Town Judge - In a town, there are n people labeled from 1 to n. There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: 1. The town judge trusts nobody. 2. E leetcode.com LeetCode - Find the Town Judge 문제 ..
https://leetcode.com/problems/bitwise-and-of-numbers-range/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Leetcode - Bitwise AND of Numbers Range 문제 유형 : 비트마스킹 문제 난이도 : Medium 문제 Given two integers left and ri..
https://leetcode.com/problems/missing-number/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Leetcode - Missing Number 문제 유형 : 정렬, 해시, 비트마스킹, 수학 문제 난이도 : Easy 문제 Given an array nums containing n distinct number..
https://leetcode.com/problems/power-of-two/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Leetcode - Power of Two 문제 유형 : 비트마스킹, 재귀 문제 난이도 : Easy 문제 Given an integer n, return true if it is a power of two. Oth..
https://leetcode.com/problems/meeting-rooms-iii/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Leetcode - Meeting Rooms III 문제 유형 : 우선순위 큐 문제 난이도 : Hard 문제 You are given an integer n. There are n rooms numbered from 0 to ..