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.
Determine if you are able to reach the last index.
Example
A = [2,3,1,1,4], return true.
A = [3,2,1,0,4], return false.
解题思路:本题给的提示是Greedy,但是Greedy很明显存在重复计算的问题啊?看了网上的一些解法,很明显没有考虑到重复计算的去除问题。
重复计算的产生:如下图,在位置A,B,C中都会发......
阅读全文