목록정렬 (32)
넘치게 채우기
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..
https://leetcode.com/problems/minimum-increment-to-make-array-unique/description/leetcode - Minimum Increment to Make Array Unique문제 유형 : 정렬, 그리디문제 난이도 : Medium 문제You are given an integer array nums. In one move, you can pick an index i where 0 and increment nums[i] by 1.Return the minimum number of moves to make every value in nums unique.The test cases are generated so that the answer fits in..
https://leetcode.com/problems/minimum-number-of-moves-to-seat-everyone/description/leetcode - Minimum Number of Moves to Seat Everyone문제 유형 : 정렬, 그리디문제 난이도 : Easy 문제There are n seats and n students in a room. You are given an array seats of length n, where seats[i] is the position of the ith seat. You are also given the array students of length n, where students[j] is the position of the jth stu..
https://leetcode.com/problems/sort-colors/leetcode - Sort Colors문제 유형 : 정렬문제 난이도 : Medium 문제Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively.You must solve this problem wi..
https://leetcode.com/problems/relative-sort-array/description/leetcode - Relative Sort Array문제 유형 : 정렬, 해시문제 난이도 : Easy 문제Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1.Sort the elements of arr1 such that the relative ordering of items in arr1 are the same as in arr2. Elements that do not appear in arr2 should be placed at the end of ..
https://leetcode.com/problems/height-checker/description/leetcode - Height Checker문제 유형 : 정렬문제 난이도 : Easy 문제A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by height. Let this ordering be represented by the integer array expected where expected[i] is the expected height of the ith student in line.You ar..
https://leetcode.com/problems/minimum-cost-to-hire-k-workers/description/leetcode - Minimum Cost to Hire K Workers문제 유형 : 우선순위 큐, 정렬문제 난이도 : Hard 문제There are n workers. You are given two integer arrays quality and wage where quality[i] is the quality of the ith worker and wage[i] is the minimum wage expectation for the ith worker.We want to hire exactly k workers to form a paid group. To hire a ..
https://leetcode.com/problems/maximize-happiness-of-selected-children/description/leetcode - Maximize Happiness of Selected Children문제 유형 : 정렬 / 그리디문제 난이도 : Medium 문제You are given an array happiness of length n, and a positive integer k.There are n children standing in a queue, where the ith child has happiness value happiness[i]. You want to select k children from these n children in k turns.In..
https://leetcode.com/problems/boats-to-save-people/description/leetcode - Boats to Save People문제 유형 : 정렬, 그리디, 투 포인터문제 난이도 : Medium 문제You are given an array people where people[i] is the weight of the ith person, and an infinite number of boats where each boat can carry a maximum weight of limit. Each boat carries at most two people at the same time, provided the sum of the weight of those peopl..
https://leetcode.com/problems/largest-positive-integer-that-exists-with-its-negative/description/leetcode - Largest Positive Integer That Exists With Its Negative문제 유형 : 정렬, 구현, 그리디, 투포인터문제 난이도 : Easy 문제Given an integer array nums that does not contain any zeros, find the largest positive integer k such that -k also exists in the array.Return the positive integer k. If there is no such integer, ..