823. Maximum Sum Increasing Subsequence (Recursive)

HardRecursionRecursion

Given an integer array, find the maximum sum of a strictly increasing subsequence.

Input: An integer array.

Output: Integer.

Examples

Example 1
Input: [1,101,2,3,100,4,5]
Output: 106
Explanation: Subsequence [1,2,3,100] sums to 106.
Example 2
Input: [3,4,5,10]
Output: 22
Explanation: [3,4,5,10] sums to 22.

Constraints

Asked by

AmazonGoogleMicrosoftMetaAdobe
Solve this problem in the editor →