목록우선순위큐 (30)
넘치게 채우기
https://leetcode.com/problems/find-score-of-an-array-after-marking-all-elements/description/?envType=daily-question&envId=2024-12-13leetcode - Find Score of an Array After Marking All Elements문제 유형: 우선순위 큐문제 난이도: Medium 문제You are given an array nums consisting of positive integers.Starting with score = 0, apply the following algorithm:Choose the smallest integer of the array that is not marked. ..
https://leetcode.com/problems/kth-largest-sum-in-a-binary-tree/description/?envType=daily-question&envId=2024-10-22leetcode - Kth Largest Sum in a Binary Tree문제 유형: BFS, 우선순위 큐문제 난이도: Medium 문제You are given the root of a binary tree and a positive integer k.The level sum in the tree is the sum of the values of the nodes that are on the same level.Return the kth largest level sum in the tree (not..
https://leetcode.com/problems/longest-happy-string/description/?envType=daily-question&envId=2024-10-16leetcode - Longest Happy String문제 유형: 우선순위 큐, 그리디문제 난이도: Medium 문제A string s is called happy if it satisfies the following conditions:s only contains the letters 'a', 'b', and 'c'.s does not contain any of "aaa", "bbb", or "ccc" as a substring.s contains at most a occurrences of the letter 'a'...
https://leetcode.com/problems/maximal-score-after-applying-k-operations/description/?envType=daily-question&envId=2024-10-14leetcode - Maximal Score After Applying K Operations문제 유형: 우선순위 큐, 그리디문제 난이도: Medium 문제You are given a 0-indexed integer array nums and an integer k. You have a starting score of 0.In one operation:choose an index i such that 0 increase your score by nums[i], andreplace num..
https://leetcode.com/problems/divide-intervals-into-minimum-number-of-groups/description/?envType=daily-question&envId=2024-10-12leetcode - Divide Intervals Into Minimum Numbers of Groups문제 유형: 우선순위 큐, 정렬문제 난이도: Medium 문제You are given a 2D integer array intervals where intervals[i] = [lefti, righti] represents the inclusive interval [lefti, righti].You have to divide the intervals into one or mo..
https://leetcode.com/problems/the-number-of-the-smallest-unoccupied-chair/description/?envType=daily-question&envId=2024-10-11leetcode - The Number of the Smallest Unoccupied Chair문제 유형: 정렬, 우선순위 큐문제 난이도: Medium 문제There is a party where n friends numbered from 0 to n - 1 are attending. There is an infinite number of chairs in this party that are numbered from 0 to infinity. When a friend arrives..
https://leetcode.com/problems/modify-graph-edge-weights/description/?envType=daily-question&envId=2024-08-30leetcode - Modift Graph Edge Weights문제 유형 : 우선순위 큐, 다익스트라, 최단거리문제 난이도 : Hard 문제You are given an undirected weighted connected graph containing n nodes labeled from 0 to n - 1, and an integer array edges where edges[i] = [ai, bi, wi] indicates that there is an edge between nodes ai and bi w..
https://leetcode.com/problems/path-with-maximum-probability/description/?envType=daily-question&envId=2024-08-27leetcode - Path with Maximum Probability문제 유형 : 최단거리, 다익스트라, bfs, 우선순위 큐, 그래프문제 난이도 : Medium 문제You are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connecting the nodes a and b with a probability of..
https://leetcode.com/problems/ugly-number-ii/description/?envType=daily-question&envId=2024-08-18leetcode - Ugly Number II문제 유형 : 우선순위 큐, 수학, 구현문제 난이도 : Medium 문제An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.Given an integer n, return the nth ugly number. ugly number는 2,3,5만을 소인수로 갖는 양의 정수이다.n이 주어지면, n번째 ugly number를 구하시오. 풀이1은 2, 3, 5를 각각 0개씩 갖고 있는 양의 정수이므로..
https://leetcode.com/problems/sort-the-people/description/leetcode - Sort the People문제 유형 : 정렬, 우선순위 큐문제 난이도 : Easy 문제You are given an array of strings names, and an array heights that consists of distinct positive integers. Both arrays are of length n.For each index i, names[i] and heights[i] denote the name and height of the ith person.Return names sorted in descending order by the people's he..