- Today
- Total
목록leetcode (186)
작심삼일
문제 링크: https://leetcode.com/problems/candy/ 문제 There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings. You are giving candies to these children subjected to the following requirements: Each child must have at least one candy. Children with a higher rating get more candies than their neighbors. Return the minimum number of candies you nee..
문제 링크: https://leetcode.com/problems/maximum-units-on-a-truck/ 문제 You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [$numberOfBoxes_i$, $numberOfUnitsPerBox_i$]: $numberOfBoxes_i$ is the number of boxes of type i. $numberOfUnitsPerBox_i$ is the number of units in each box of the type i. You are also given an integer truckSize, whi..
문제 링크: https://leetcode.com/problems/queue-reconstruction-by-height/ 문제 You are given an array of people, people, which are the attributes of some people in a queue (not necessarily in order). Each people[i] = [$h_i$, $k_i$] represents the ith person of height hi with exactly $k_i$ other people in front who have a height greater than or equal to $h_i$. Reconstruct and return the queue that is re..
문제 링크: https://leetcode.com/problems/minimum-deletions-to-make-character-frequencies-unique/ 문제 A string s is called good if there are no two different characters in s that have the same frequency. Given a string s, return the minimum number of characters you need to delete to make s good. The frequency of a character in a string is the number of times it appears in the string. For example, in t..
문제 링크: https://leetcode.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers/ 문제 A decimal number is called deci-binary if each of its digits is either 0 or 1 without any leading zeros. For example, 101 and 1100 are deci-binary, while 112 and 3001 are not. Given a string n that represents a positive decimal integer, return the minimum number of positive deci-binary numbers needed..
문제 링크: https://leetcode.com/problems/course-schedule-iii/ 문제 There are n different online courses numbered from 1 to n. You are given an array courses where courses[i] = [$duration_i$, $lastDay_i$] indicate that the ith course should be taken continuously for durationi days and must be finished before or on $lastDay_i$. You will start on the 1st day and you cannot take two or more courses simult..
문제 링크: https://leetcode.com/problems/kth-largest-element-in-an-array/ 문제 Given an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kth largest element in the sorted order, not the kth distinct element. 조건 1
문제 링크: https://leetcode.com/problems/short-encoding-of-words/ 문제 A valid encoding of an array of words is any reference string s and array of indices indices such that: words.length == indices.length The reference string s ends with the '#' character. For each index indices[i], the substring of s starting from indices[i] and up to (but not including) the next '#' character is equal to words[i]. ..