목록LeetCode (523)
넘치게 채우기
https://leetcode.com/problems/continuous-subarrays/description/leetcode - Continuous Subarrays문제 유형: 슬라이딩 윈도우, 모노토닉 스택, 모노토닉 큐, 모노토닉 데크문제 난이도: Medium 문제You are given a 0-indexed integer array nums. A subarray of nums is called continuous if:Let i, i + 1, ..., j be the indices in the subarray. Then, for each pair of indices i 0 Return the total number of continuous subarrays.A subarray is a cont..
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/take-gifts-from-the-richest-pile/description/leetcode - Take Gifts From the Richest Pile문제 유형: 우선순위 큐문제 난이도: Easy 문제You are given an integer array gifts denoting the number of gifts in various piles. Every second, you do the following:Choose the pile with the maximum number of gifts.If there is more than one pile with the maximum number of gifts, choose any.Leave be..
https://leetcode.com/problems/maximum-beauty-of-an-array-after-applying-operation/description/leetcode - Maximum Beauty of an Array After Applying Operation문제 유형: 정렬, 슬라이딩 윈도우문제 난이도: Medium 문제You are given a 0-indexed array nums and a non-negative integer k.In one operation, you can do the following:Choose an index i that hasn't been chosen before from the range [0, nums.length - 1].Replace nums..
https://leetcode.com/problems/find-longest-special-substring-that-occurs-thrice-i/description/leetcode - Find Longest Special Substring That Occurs Thrice I문제 유형: 문자열 처리, 슬라이딩 윈도우문제 난이도: Medium 문제You are given a string s that consists of lowercase English letters.A string is called special if it is made up of only a single character. For example, the string "abc" is not special, whereas the stri..
https://leetcode.com/problems/special-array-ii/description/leetcode - Special Array II문제 유형: 이진 탐색문제 난이도: Medium 문제An array is considered special if every pair of its adjacent elements contains two numbers with different parity.You are given an array of integer nums and a 2D integer matrix queries, where for queries[i] = [fromi, toi] your task is to check that subarray nums[fromi..toi] is specia..
https://leetcode.com/problems/two-best-non-overlapping-events/description/leetcode - Two Best Non-Overlapping Events문제 유형: 이진 탐색문제 난이도: Medium 문제You are given a 0-indexed 2D integer array of events where events[i] = [startTimei, endTimei, valuei]. The ith event starts at startTimei and ends at endTimei, and if you attend this event, you will receive a value of valuei. You can choose at most two ..
https://leetcode.com/problems/minimum-limit-of-balls-in-a-bag/description/leetcode - Minimum Limit of Balls in a Bag문제 유형: 이진 탐색문제 난이도: Medium 문제You are given an integer array nums where the ith bag contains nums[i] balls. You are also given an integer maxOperations.You can perform the following operation at most maxOperations times:Take any bag of balls and divide it into two new bags with a po..
https://leetcode.com/problems/maximum-number-of-integers-to-choose-from-a-range-i/description/leetcode - Maximum Number of Intergers to Choose From a Range I문제 유형: 그리디문제 난이도: Medium 문제You are given an integer array banned and two integers n and maxSum. You are choosing some number of integers following the below rules:The chosen integers have to be in the range [1, n].Each integer can be chosen ..
https://leetcode.com/problems/move-pieces-to-obtain-a-string/description/leetcode - Move Pieces to Obtain a String문제 유형: 투 포인터, 문자열 처리, 그리디문제 난이도: Medium 문제You are given two strings start and target, both of length n. Each string consists only of the characters 'L', 'R', and '_' where:The characters 'L' and 'R' represent pieces, where a piece 'L' can move to the left only if there is a blank spa..