목록PS/LeetCode (591)
넘치게 채우기
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 ..
https://leetcode.com/problems/create-binary-tree-from-descriptions/description/leetcode - Create Binary Tree From Descriptions문제 유형 : 이진트리문제 난이도 : Medium 문제You are given a 2D integer array descriptions where descriptions[i] = [parenti, childi, isLefti] indicates that parenti is the parent of childi in a binary tree of unique values. Furthermore,If isLefti == 1, then childi is the left child of ..
https://leetcode.com/problems/number-of-atoms/description/leetcode - Number of Atoms문제 유형 : 스택, 재귀, 문자열 처리문제 난이도 : Hard 문제Given a string formula representing a chemical formula, return the count of each atom.The atomic element always starts with an uppercase character, then zero or more lowercase letters, representing the name.One or more digits representing that element's count may follow if th..
https://leetcode.com/problems/robot-collisions/description/leetcode - Robot Collisions문제 유형 : 스택문제 난이도 : Hard 문제There are n 1-indexed robots, each having a position on a line, health, and movement direction.You are given 0-indexed integer arrays positions, healths, and a string directions (directions[i] is either 'L' for left or 'R' for right). All integers in positions are unique.All robots sta..
https://leetcode.com/problems/maximum-score-from-removing-substrings/leetcode - Maximum Score From Removing Substrings문제 유형 : 그리디, 스택, 슬라이딩 윈도우 문제 난이도 : Medium 문제You are given a string s and two integers x and y. You can perform two types of operations any number of times. Remove substring "ab" and gain x points. For example, when removing "ab" from "cabxbae" it becomes "cxbae". Remove substring..
https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses/description/leetcode - Reverse Substrings Between Each Pair of Parentheses문제 유형 : 스택문제 난이도 : Medium 문제You are given a string s that consists of lower case English letters and brackets.Reverse the strings in each pair of matching parentheses, starting from the innermost one.Your result should not contain any bracket..
https://leetcode.com/problems/crawler-log-folder/description/leetcode - Crawler Log Folder문제 유형 : 구현문제 난이도 : Easy 문제The Leetcode file system keeps a log each time some user performs a change folder operation.The operations are described below:"../" : Move to the parent folder of the current folder. (If you are already in the main folder, remain in the same folder)."./" : Remain in the same folde..
https://leetcode.com/problems/average-waiting-time/description/leetcode - Average Waiting Time문제 유형: 배열, 구현문제 난이도 : Medium 문제There is a restaurant with a single chef. You are given an array customers, where customers[i] = [arrivali, timei]:arrivali is the arrival time of the ith customer. The arrival times are sorted in non-decreasing order.timei is the time needed to prepare the order of the it..
https://leetcode.com/problems/find-the-winner-of-the-circular-game/description/leetcode - Find the Winner of the Circular Game문제 유형 : 배열문제 난이도 : Medium 문제There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwise from the ith friend brings you to the (i+1)th friend for 1 nth friend brings you ..