← 返回 akunacapital 的题目列表Maximum Non-consecutive Jump Sum
类型:online_judge
Given an array, you are allowed to skip elements during summation, but you cannot skip two consecutive times. Implement a dynamic programming algorithm to calculate the largest possible sum from the array.
Example Input
Array = [4, 5, 8, 10]
Example Output
18
Example
Input
[4, 5, 8, 10]