Return true if you can reach the last index starting from index 0 with maximum jump lengths given by nums[i].
Input: nums = [2,3,1,1,4]
Output: true
Topics: greedy, dp
Asked by: Amazon, Microsoft
Time complexity: O(n). Space complexity: O(1).