2014年3月16日

LeetCode: Jump Game II

摘要: 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 is to reach the last index in the minimum number of jumps.最开始想像jump game I一样用动态规划,发现会超时。所以想到了用贪心算法。可以计算每一步可以跳 阅读全文

posted @ 2014-03-16 09:07 longhorn 阅读(163) 评论(0) 推荐(0) 编辑

导航