greedy
Goofiness
这个作者很懒,什么都没留下…
展开
-
[LeetCode]Video Stitching@Golang
Video Stitching You are given a series of video clips from a sporting event that lasted T seconds. These video clips can be overlapping with each other and have varied lengths. Each video clip clips[...原创 2019-10-21 18:40:59 · 140 阅读 · 0 评论 -
[Leetcode]Maximum Length of Pair Chain@Python
Maximum Length of Pair Chain You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c, d) can follow another pair (a, b) if...原创 2019-09-05 16:39:39 · 98 阅读 · 0 评论 -
[LeetCode]Boats to Save People@Python
Boats to Save People The i-th person has weight people[i], and each boat can carry a maximum weight of limit. Each boat carries at most 2 people at the same time, provided the sum of the weight of tho...原创 2019-06-28 11:30:04 · 96 阅读 · 0 评论 -
[LeetCode]Advantage Shuffle@Python
Advantage Shuffle Given two arrays A and B of equal size, the advantage of A with respect to B is the number of indices i for which A[i] > B[i]. Return any permutation of A that maximizes its advan...原创 2019-06-28 10:23:44 · 273 阅读 · 0 评论 -
[LeetCode]Partition Labels@Python
Partition Labels A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integer...原创 2019-06-24 17:27:24 · 155 阅读 · 0 评论 -
[LeetCode]Score After Flipping Matrix@Python
Score After Flipping Matrix We have a two dimensional matrix A where each value is 0 or 1. A move consists of choosing any row or column, and toggling each value in that row or column: changing all 0s...原创 2019-06-27 00:21:15 · 140 阅读 · 0 评论 -
[LeetCode]Monotone Increasing Digits@Python
Monotone Increasing Digits Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits. (Recall that an integer has monotone increasing digi...原创 2019-06-22 11:39:59 · 111 阅读 · 0 评论 -
[LeetCode]Gas Station@Python
Gas Station There 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 gas tank and it costs cost[i] of gas to travel from statio...原创 2019-06-12 00:10:29 · 103 阅读 · 0 评论 -
[LeetCode]Lemonade Change@Python
Lemonade Change At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills). Each customer will only buy o...原创 2019-06-21 00:52:28 · 106 阅读 · 0 评论 -
[LeetCode]Jump Game@Python
Jump Game Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Determi...原创 2019-06-11 00:09:16 · 122 阅读 · 0 评论 -
[LeetCode]Queue Reconstruction by Height@Python
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), where h is the height of the person and k is the num...原创 2019-06-14 23:58:57 · 99 阅读 · 0 评论 -
[LeetCode]Assign Cookies@Python
Assign Cookies Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimu...原创 2019-06-18 22:26:35 · 153 阅读 · 0 评论 -
[LeetCode]Non-overlapping Intervals@Python
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-overlapping. Note: You may assume the interval’...原创 2019-06-18 22:08:22 · 125 阅读 · 0 评论 -
[LeetCode]Is Subsequence@Python
Is Subsequence Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is potentially a very long (length ~= 50...原创 2019-06-14 09:59:39 · 159 阅读 · 0 评论 -
[LeetCode]Wiggle Subsequence@Python
Wiggle Subsequence A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists...原创 2019-06-12 23:36:51 · 104 阅读 · 0 评论