![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
文章平均质量分 52
xiaocong1990
这个作者很懒,什么都没留下…
展开
-
[leetcode]avoid-flood-in-the-city 避免洪水泛滥
【代码】[leetcode]avoid-flood-in-the-city 避免洪水泛滥。原创 2024-06-27 10:48:29 · 218 阅读 · 0 评论 -
[leetcode]assign-cookies. 分发饼干
【代码】[leetcode]assign-cookies. 分发饼干。原创 2024-06-26 19:07:38 · 153 阅读 · 0 评论 -
[leetcode]boats-to-save-people. 救生艇
【代码】[leetcode]boats-to-save-people. 救生艇。原创 2024-06-26 09:28:34 · 131 阅读 · 0 评论 -
[leetcode]406. Queue Reconstruction by Height
题目链接:https://leetcode.com/problems/queue-reconstruction-by-height/Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers(h, k), wherehi原创 2017-01-06 22:01:31 · 201 阅读 · 1 评论 -
[leetcode]475. Heaters
题目链接:https://leetcode.com/problems/heaters/Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses.Now, you are given原创 2017-01-02 16:09:03 · 222 阅读 · 1 评论 -
[leetcode]435. 无重叠区间
你需要移除两个 [1,2] 来使剩下的区间没有重叠。你不需要移除任何区间,因为它们已经是无重叠的了。需要移除区间的最小数量,使剩余区间互不重叠。移除 [1,3] 后,剩下的区间没有重叠。原创 2024-04-09 19:54:12 · 164 阅读 · 0 评论 -
[leetcode]2365. Task Scheduler II
给你一个下标从 0 开始的正整数数组 tasks ,表示需要 按顺序 完成的任务,其中 tasks[i] 表示第 i 件任务的 类型。同时给你一个正整数 space ,表示一个任务完成 后 ,另一个 相同 类型任务完成前需要间隔的 最少 天数。输入:tasks = [1,2,1,2,3,1], space = 3。第 1 天:完成任务 0。第 2 天:完成任务 1。第 5 天:完成任务 2。第 1 天:完成任务 0。第 2 天:完成任务 1。第 5 天:完成任务 2。原创 2023-07-24 23:09:40 · 215 阅读 · 0 评论 -
[leetcode] 55. Jump Game
解释:无论怎样,总会到达下标为 3 的位置。但该下标的最大跳跃长度是 0 , 所以永远不可能到达最后一个下标。解释:可以先跳 1 步,从下标 0 到达下标 1, 然后再从下标 1 跳 3 步到达最后一个下标。链接:https://leetcode.cn/problems/jump-game。给定一个非负整数数组 nums ,你最初位于数组的 第一个下标。数组中的每个元素代表你在该位置可以跳跃的最大长度。输入:nums = [2,3,1,1,4]输入:nums = [3,2,1,0,4]原创 2023-07-18 12:35:38 · 421 阅读 · 0 评论 -
[leetcode]435. Non-overlapping Intervals
题目链接:https://leetcode.com/problems/non-overlapping-intervals/Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overla原创 2017-01-31 21:09:11 · 238 阅读 · 1 评论 -
[leetcode]678. Valid Parenthesis String
链接:https://leetcode.com/problems/valid-parenthesis-string/description/Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is val...原创 2018-09-12 12:28:14 · 177 阅读 · 0 评论 -
[leetcode]169. Majority Element
链接:https://leetcode.com/problems/majority-element/description/Given an array of sizen, find the majority element. The majority element is the element that appearsmore than⌊ n/2 ⌋times.You may ...原创 2018-09-01 15:01:48 · 110 阅读 · 1 评论 -
[leetcode]268. Missing Number
链接:https://leetcode.com/problems/missing-number/description/Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.Example 1:Input:...原创 2018-09-01 14:52:51 · 97 阅读 · 0 评论 -
[leetcode]763. Partition Labels
链接:https://leetcode.com/problems/partition-labels/description/A stringSof lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in...原创 2018-08-11 17:36:01 · 150 阅读 · 1 评论 -
[leetcode]135. Candy 分发糖果
链接:https://leetcode.com/problems/candy/description/There areNchildren standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following re...原创 2018-05-31 15:09:45 · 145 阅读 · 1 评论 -
[leetcode]97. Interleaving String
链接:https://leetcode.com/problems/interleaving-string/description/Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.Example 1:Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcb...原创 2018-05-28 14:54:44 · 143 阅读 · 0 评论 -
[leetcode]45. Jump Game II
链接:https://leetcode.com/problems/jump-game-ii/description/Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents you...原创 2018-05-13 19:47:59 · 174 阅读 · 0 评论 -
[leetcode]765. Couples Holding Hands
链接:https://leetcode.com/problems/couples-holding-hands/description/N couples sit in 2N seats arranged in a row and want to hold hands. We want to know the minimum number of swaps so that every couple ...原创 2018-05-12 15:48:08 · 250 阅读 · 0 评论 -
[leetcode]334. Increasing Triplet Subsequence
题目链接:https://leetcode.com/problems/increasing-triplet-subsequence/?tab=DescriptionGiven an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Form原创 2017-03-12 16:18:47 · 239 阅读 · 0 评论 -
[leetcode]56. Merge Intervals
题目链接:https://leetcode.com/problems/merge-intervals/#/descriptionGiven a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6]原创 2017-05-24 17:33:42 · 533 阅读 · 0 评论 -
[leetcode]134. Gas Station
题目链接:https://leetcode.com/problems/gas-station/#/descriptionThere are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited g原创 2017-05-24 20:23:30 · 300 阅读 · 0 评论 -
[leetcode]402. Remove K Digits
题目链接:https://leetcode.com/problems/remove-k-digits/#/description Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest po...原创 2017-05-16 20:15:05 · 224 阅读 · 0 评论 -
[leetcode]376. Wiggle Subsequence
题目链接:https://leetcode.com/problems/wiggle-subsequence/#/descriptionA sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between posi原创 2017-05-08 11:30:14 · 224 阅读 · 0 评论 -
[leetcode]55. Jump Game
题目链接:https://leetcode.com/problems/jump-game/#/descriptionGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array repr原创 2017-06-14 10:58:09 · 197 阅读 · 0 评论 -
[leetcode]621. Task Scheduler
题目链接:https://leetcode.com/problems/task-scheduler/#/descriptionGiven a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different原创 2017-07-24 11:15:05 · 309 阅读 · 0 评论 -
[leetcode]646. Maximum Length of Pair Chain
题目链接:https://leetcode.com/problems/maximum-length-of-pair-chain/#/descriptionYou are given n pairs of numbers. In every pair, the first number is always smaller than the second number.Now,原创 2017-07-26 11:00:04 · 314 阅读 · 0 评论 -
[leetcode]649. Dota2 Senate
题目链接:https://leetcode.com/problems/dota2-senate/description/In the world of Dota2, there are two parties: the Radiant and the Dire.The Dota2 senate consists of senators coming from two p原创 2017-08-11 17:34:47 · 703 阅读 · 0 评论 -
[leetcode]502. IPO
题目链接:https://leetcode.com/problems/ipo/description/Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some p原创 2017-08-12 21:15:19 · 267 阅读 · 0 评论 -
[leetcode]330. Patching Array
题目链接:https://leetcode.com/problems/patching-array/description/Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n]i原创 2017-08-14 17:11:19 · 219 阅读 · 0 评论 -
[leetcode]316. Remove Duplicate Letters
题目链接:https://leetcode.com/problems/remove-duplicate-letters/description/Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only o原创 2017-08-28 11:05:34 · 274 阅读 · 0 评论 -
[leetcode]410. Split Array Largest Sum 分割数组的最大值
题目链接:https://leetcode.com/problems/split-array-largest-sum/#/descriptionGiven an array which consists of non-negative integers and an integerm, you can split the array intomnon-empty continuo原创 2017-06-27 21:57:39 · 338 阅读 · 1 评论 -
[leetcode]452. Minimum Number of Arrows to Burst Balloons
题目链接:https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the st原创 2017-01-16 13:28:06 · 325 阅读 · 0 评论