- Today
- Total
목록스터디 (250)
작심삼일
문제 링크: https://leetcode.com/problems/find-the-duplicate-number/ 문제 Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number in nums, return this repeated number. You must solve the problem without modifying the array nums and uses only constant extra space. 조건 1
문제 링크: https://leetcode.com/problems/search-in-rotated-sorted-array-ii/ 문제 There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values). Before being passed to your function, nums is rotated at an unknown pivot index k (0
문제 링크: https://leetcode.com/problems/two-city-scheduling/ 문제 A company is planning to interview 2n people. Given the array costs where costs[i] = [aCosti, bCosti], the cost of flying the ith person to city a is aCosti, and the cost of flying the ith person to city b is bCosti. Return the minimum cost to fly every person to a city such that exactly n people arrive in each city. 조건 2 * n == costs...
문제 링크: https://leetcode.com/problems/boats-to-save-people/ 문제 You are given an array people where people[i] is the weight of the $i^{th}$ 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 people is at most limit. Return the minimum number of boats to carry eve..
문제 링크: https://leetcode.com/problems/broken-calculator/ 문제 There is a broken calculator that has the integer startValue on its display initially. In one operation, you can: multiply the number on display by 2, or subtract 1 from the number on display. Given two integers startValue and target, return the minimum number of operations needed to display target on the calculator. 조건 1 startValue: ans..
문제 링크: https://leetcode.com/problems/smallest-string-with-a-given-numeric-value/ 문제 The numeric value of a lowercase character is defined as its position (1-indexed) in the alphabet, so the numeric value of a is 1, the numeric value of b is 2, the numeric value of c is 3, and so on. The numeric value of a string consisting of lowercase characters is defined as the sum of its characters' numeric ..

문제 링크: https://leetcode.com/problems/partition-labels/ 문제 You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part. Note that the partition is done so that after concatenating all the parts in order, the resultant string should be s. Return a list of integers representing the size of these parts. 조건 1 0: ans.append(m..
문제 링크: https://leetcode.com/problems/remove-duplicate-letters/ 문제 Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicographical order among all possible results. 조건 1 0 and ans[-1] > char and count[ord(ans[-1])-ord('a')] > 0: check[ord(ans[-1])-ord('a')] = False del ans[-1] ans.append(char) check[idx]..