
Greedy
豆腐脑是咸的
这个作者很懒,什么都没留下…
展开
-
Jump Game II (Java)
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. Your goal i原创 2015-01-29 17:16:22 · 398 阅读 · 0 评论 -
Jump Game (Java)
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 i原创 2015-01-16 21:10:47 · 598 阅读 · 0 评论 -
Gas Station (Java)
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原创 2015-01-16 22:30:33 · 399 阅读 · 0 评论 -
Best Time to Buy and Sell Stock II (Java)
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on原创 2015-01-17 23:05:23 · 334 阅读 · 0 评论 -
Candy (Java)
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 requirements: Each child must have at least on原创 2015-02-09 10:35:08 · 470 阅读 · 0 评论