목록재귀 (61)
넘치게 채우기
https://leetcode.com/problems/lexicographical-numbers/description/?envType=daily-question&envId=2024-09-21leetcode - Lexicographical Numbers문제 유형 : 수학, 구현, dfs, 재귀문제 난이도 : Medium 문제Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order.You must write an algorithm that runs in O(n) time and uses O(1) extra space. 정수 n이 주어진다. [1, n]의 모든 숫자들을 사전순으로 정렬하여 반환하시..
https://leetcode.com/problems/different-ways-to-add-parentheses/description/?envType=daily-question&envId=2024-09-19leetcode - Different Ways to Add Parentheses문제 유형 : 문자열 처리, 재귀, 다이나믹 프로그래밍, 카탈란 수문제 난이도 : Medium 문제Given a string expression of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. You may return the answe..
https://leetcode.com/problems/linked-list-in-binary-tree/description/?envType=daily-question&envId=2024-09-07leetcode - Linked List in Binary Tree문제 유형 : 이진트리, 연결리스트문제 난이도 : Medium 문제Given a binary tree root and a linked list with head as the first node.Return True if all the elements in the linked list starting from the head correspond to some downward path connected in the binary tree otherwis..
https://leetcode.com/problems/n-ary-tree-postorder-traversal/description/?envType=daily-question&envId=2024-08-26leetcode - N-ary Tree Postorder Traversal문제 유형 : 트리, dfs, 재귀, 스택문제 난이도 : Easy 문제Given the root of an n-ary tree, return the postorder traversal of its nodes' values.Nary-Tree input serialization is represented in their level order traversal. Each group of children is separated by the ..
https://leetcode.com/problems/strange-printer/description/?envType=daily-question&envId=2024-08-21leetcode - Strange Printer문제 유형 : 문자열 처리, 재귀, 다이나믹 프로그래밍, 투 포인터문제 난이도 : Hard 문제There is a strange printer with the following two special properties:The printer can only print a sequence of the same character each time.At each turn, the printer can print new characters starting from and ending at any..
https://leetcode.com/problems/2-keys-keyboard/solutions/?envType=daily-question&envId=2024-08-19leetcode - 2 Keys Keyboard문제 유형 : 다이나믹 프로그래밍, 재귀, 수학문제 난이도 : Medium 문제There is only one character 'A' on the screen of a notepad. You can perform one of two operations on this notepad for each step:Copy All: You can copy all the characters present on the screen (a partial copy is not allowed).Paste: Y..
https://leetcode.com/problems/combination-sum-ii/description/?envType=daily-question&envId=2024-08-13leetcode - Combination Sum II문제 유형 : 백트래킹, dfs, 재귀문제 난이도 : Medium 문제Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target.Each number in candidates may only be used once in the combin..
https://leetcode.com/problems/number-of-good-leaf-nodes-pairs/description/leetcode - Number of Good Leaf Nodes Paris문제 유형 : 이진트리, 재귀문제 난이도 : Medium 문제You are given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length of the shortest path between them is less than or equal to distance.Return the number of good leaf..
https://leetcode.com/problems/delete-nodes-and-return-forest/description/leetcode - Delete Nodes And Return Forest문제 유형 : 이진트리, 재귀문제 난이도 : Medium 문제Given the root of a binary tree, each node in the tree has a distinct value.After deleting all nodes with a value in to_delete, we are left with a forest (a disjoint union of trees).Return the roots of the trees in the remaining forest. You may retur..
https://leetcode.com/problems/step-by-step-directions-from-a-binary-tree-node-to-another/description/leetcode - Step-By-Step Directions From a Binary Tree Node to Another문제 유형 : 이진트리, 재귀, 백트래킹문제 난이도 : Medium 문제You are given the root of a binary tree with n nodes. Each node is uniquely assigned a value from 1 to n. You are also given an integer startValue representing the value of the start node ..