![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode 贪心
zg轩
你要知道什么是自己想要的,知道什么是不可逆转的,知道用什么方式实现梦想,知道用什么心情面对苦难,人就在转瞬间感悟,进退得失不离不弃也就有了答案。我不知道命运会把我带到何方,但是我会一直用善良维护其左右
展开
-
leetcode 765夫妻握手
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 is sitting side by side. A swap consists of choosing any two people...原创 2019-02-15 12:47:44 · 186 阅读 · 0 评论 -
leetcode 955以列为单位进行删除使得字符串数组有序
题目:We are given an array A of N lowercase letter strings, all of the same length.Now, we may choose any set of deletion indices, and for each string, we delete all the characters in those indices.F...原创 2019-02-13 16:12:09 · 405 阅读 · 0 评论 -
leetcode 55跳跃游戏
题目: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.Determine if ...原创 2019-02-13 14:07:21 · 109 阅读 · 0 评论 -
Leetcode 134加油站
题目: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 station i to i...原创 2019-02-13 11:10:11 · 155 阅读 · 0 评论 -
leetcode 376. 摆动序列
题目: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) may be either ...原创 2019-02-13 08:59:30 · 352 阅读 · 0 评论 -
leetcode 649Dota2参议院
题目:In the world of Dota2, there are two parties: the Radiant and the Dire.The Dota2 senate consists of senators coming from two parties. Now the senate wants to make a decision about a change in the ...原创 2019-02-12 16:24:27 · 309 阅读 · 2 评论 -
leetcode 659连续数组分割子连续序列
You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subsequences consist of at least 3 consecutive integers....原创 2019-02-12 15:02:18 · 526 阅读 · 0 评论 -
leetcode 767重新分配字符串
题目:Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same.If possible, output any possible result. If not possible, return t...原创 2019-02-12 11:58:21 · 278 阅读 · 0 评论 -
leetcode 738 单调递增数字位
题目: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 digits if and only if each p...原创 2019-02-12 10:38:07 · 379 阅读 · 0 评论 -
leetcode 870优点重排
题目: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 advantage with resp...原创 2019-02-12 09:46:04 · 207 阅读 · 0 评论 -
leetcode 452用最少数量的箭头引爆箭头
题目:There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it’s horizontal, y-coo...原创 2019-02-10 19:41:33 · 302 阅读 · 0 评论 -
leetcode 763字符串划分
题目: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 integers representin...原创 2019-02-10 19:00:00 · 267 阅读 · 0 评论 -
leetcode 984字符串贪心
题目:Given two integers A and B, return any string S such that:S has length A + B and contains exactly A ‘a’ letters, and exactly B ‘b’ letters;The substring ‘aaa’ does not occur in S;The substring ...原创 2019-02-10 15:59:49 · 223 阅读 · 0 评论 -
leetcode 402删除k个数字
题目:Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.Note:The length of num is less than 10002 and will be ≥ ...原创 2019-02-13 17:09:18 · 701 阅读 · 0 评论