随笔分类 -  Greedy

摘要:Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your 阅读全文
posted @ 2016-12-05 06:40 微微程序媛 阅读(195) 评论(0) 推荐(0)
摘要: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: Exam 阅读全文
posted @ 2016-11-28 12:05 微微程序媛 阅读(369) 评论(0) 推荐(0)
摘要: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 hor 阅读全文
posted @ 2016-11-28 11:51 微微程序媛 阅读(224) 评论(0) 推荐(0)
摘要: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 g 阅读全文
posted @ 2016-11-25 01:04 微微程序媛 阅读(393) 评论(0) 推荐(0)
摘要: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 maxim 阅读全文
posted @ 2016-10-14 01:49 微微程序媛 阅读(133) 评论(0) 推荐(0)
摘要:There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re 阅读全文
posted @ 2016-10-14 01:47 微微程序媛 阅读(164) 评论(0) 推荐(0)
摘要: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 cost 阅读全文
posted @ 2016-10-14 00:11 微微程序媛 阅读(317) 评论(0) 推荐(0)