- Today
- Total
목록leetcode (186)
작심삼일
문제 링크: https://leetcode.com/problems/split-array-largest-sum/ 문제 Given an array nums which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among these m subarrays. 조건 1
문제 링크: https://leetcode.com/problems/search-a-2d-matrix/ 문제 Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties: Integers in each row are sorted from left to right. The first integer of each row is greater than the last integer of the previous row. 조건 m == matrix.length n == matrix[i].length 1
문제 링크: 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 ..