목록LeetCode (568)
넘치게 채우기
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..
https://leetcode.com/problems/make-string-a-subsequence-using-cyclic-increments/description/leetcode - Make String a Subsequence Using Cyclic Increments문제 유형: 투 포인터, 문자열 처리문제 난이도: Medium 문제You are given two 0-indexed strings str1 and str2.In an operation, you select a set of indices in str1, and for each index i in the set, increment str1[i] to the next character cyclically. That is 'a' becomes ..
https://leetcode.com/problems/adding-spaces-to-a-string/description/leetcode - Adding Spaces to a String문제 유형: 투 포인터, 문자열 처리문제 난이도: Medium 문제You are given a 0-indexed string s and a 0-indexed integer array spaces that describes the indices in the original string where spaces will be added. Each space should be inserted before the character at the given index.For example, given s = "EnjoyYourCoff..
https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/description/leetcode - Check If a Word Occurs As a Prefix of Any Word in a Sentence문제 유형: 문자열 처리문제 난이도: Easy 문제Given a sentence that consists of some words separated by a single space, and a searchWord, check if searchWord is a prefix of any word in sentence.Return the index of the word in sentence (1-inde..
https://leetcode.com/problems/check-if-n-and-its-double-exist/description/leetcode - Check If N and Its Double Exist문제 유형: 투 포인터문제 난이도: Easy 문제Given an array arr of integers, check if there exist two indices i and j such that :i != j0 arr[i] == 2 * arr[j]서로 다른 두 인덱스 i, j에 대해서arr[i] == arr[j] *2가 있으면 true를 반환하시오. 풀이2중for문을 돌면서 서로 다른인덱스이고 2배관계인 쌍이있으면 true를, 아니면 false를 반환해준다.단, 다른인덱스임을 고려를 반드시 해줘야하..
https://leetcode.com/problems/valid-arrangement-of-pairs/description/leetcode - Valid Arrangement of Pairs문제 유형: 그래프, 오일러 경로, 오일러 회로, dfs문제 난이도: Hard 문제You are given a 0-indexed 2D integer array pairs where pairs[i] = [starti, endi]. An arrangement of pairs is valid if for every index i where 1 endi-1 == starti.Return any valid arrangement of pairs.Note: The inputs will be generated such that t..