목록PS/LeetCode (591)
넘치게 채우기
https://leetcode.com/problems/find-center-of-star-graph/description/leetcode - Find Center of Star Graph문제 유형 : 그래프, 해시문제 난이도 : Easy 문제There is an undirected star graph consisting of n nodes labeled from 1 to n. A star graph is a graph where there is one center node and exactly n - 1 edges that connect the center node with every other node.You are given a 2D integer array edges where each edges[..
https://leetcode.com/problems/balance-a-binary-search-tree/description/leetcode - Balance a Binary Search Tree문제 유형 : 트리, 재귀, 이진트리, 이진탐색트리문제 난이도 : Medium 문제Given the root of a binary search tree, return a balanced binary search tree with the same node values. If there is more than one answer, return any of them.A binary search tree is balanced if the depth of the two subtrees of every node never..

https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/description/leetcode - Binary Search Tree to Greater Sum Tree문제 유형 : 이진트리, 이진탐색트리, dfs문제 난이도 : Medium 문제Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.As a reminder, a ..
https://leetcode.com/problems/minimum-number-of-k-consecutive-bit-flips/description/leetcode - Minimum Number of K Consecutive Bit Flips문제 유형 : 그리디 / 비트마스킹 / 슬라이딩 윈도우문제 난이도 : Hard 문제You are given a binary array nums and an integer k.A k-bit flip is choosing a subarray of length k from nums and simultaneously changing every 0 in the subarray to 1, and every 1 in the subarray to 0.Return the minim..
https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/description/leetcode - Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit문제 유형 : 슬라이딩 윈도우, 투 포인터, 데크(deque)문제 난이도 : Medium 문제Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference betwee..

https://leetcode.com/problems/count-number-of-nice-subarrays/description/leetcode - Count Number of Nice Subarrays문제 유형 : 슬라이딩 윈도우, 투포인터문제 난이도 : Medium 문제Given an array of integers nums and an integer k. A continuous subarray is called nice if there are k odd numbers on it.Return the number of nice sub-arrays. 정수배열 nums와 정수 k가 주어집니다. 연속적인 부분배열의 요소에 홀수의 요소가 정확히 k개 있으면, nice한 subarray입니다.nice한 sub..
https://leetcode.com/problems/grumpy-bookstore-owner/description/leetcode - Grumpy Bookstore Owner문제 유형 : 슬라이딩 윈도우문제 난이도 : Medium 문제There is a bookstore owner that has a store open for n minutes. Every minute, some number of customers enter the store. You are given an integer array customers of length n where customers[i] is the number of the customer that enters the store at the start of the it..
https://leetcode.com/problems/magnetic-force-between-two-balls/description/leetcode - Magnetic Force Between Two Balls문제 유형 : 이진 탐색문제 난이도 : Medium 문제In the universe Earth C-137, Rick discovered a special form of magnetic force between two balls if they are put in his new invented basket. Rick has n empty baskets, the ith basket is at position[i], Morty has m balls and needs to distribute the bal..
https://leetcode.com/problems/minimum-number-of-days-to-make-m-bouquets/description/leetcode - Minimum Number of Days to Make m Bouquets문제 유형 : 이진탐색, 그리디, 슬라이딩 윈도우, 구현문제 난이도 : Medium 문제You are given an integer array bloomDay, an integer m and an integer k.You want to make m bouquets. To make a bouquet, you need to use k adjacent flowers from the garden.The garden consists of n flowers, the ith f..
https://leetcode.com/problems/most-profit-assigning-work/description/leetcode - Most Profit Assigning Work문제 유형 : 정렬, 그리디, 이진탐색문제 난이도 : Medium 문제You have n jobs and m workers. You are given three arrays: difficulty, profit, and worker where:difficulty[i] and profit[i] are the difficulty and the profit of the ith job, andworker[j] is the ability of jth worker (i.e., the jth worker can only comple..