Tap here to switch tabs
Problem
Submissions

Problem: Maximum Ascending Subarray Sum

med
30 min
Try to solve the Maximum Ascending Subarray Sum problem.

Statement

Given an array of positive integers nums, return the maximum possible sum of an ascending subarray in nums.

A subarray is defined as a contiguous sequence of numbers in an array.

A subarray [nums[l], nums[l + 1], ..., nums[r - 1], nums[r]] is ascending if nums[k] < nums[k + 1] for all l≤k<rl \le k < r. A subarray of size 11 is considered ascending.

Constraints:

  • 1≤1 \le nums.length ≤100\le 100

  • 1≤1 \le nums[i] ≤100\le 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Ascending Subarray Sum

med
30 min
Try to solve the Maximum Ascending Subarray Sum problem.

Statement

Given an array of positive integers nums, return the maximum possible sum of an ascending subarray in nums.

A subarray is defined as a contiguous sequence of numbers in an array.

A subarray [nums[l], nums[l + 1], ..., nums[r - 1], nums[r]] is ascending if nums[k] < nums[k + 1] for all l≤k<rl \le k < r. A subarray of size 11 is considered ascending.

Constraints:

  • 1≤1 \le nums.length ≤100\le 100

  • 1≤1 \le nums[i] ≤100\le 100