五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

LeetCode 1800. Maximum Ascending Subarray Sum

2023-02-23 14:39 作者:您是打尖兒還是住店呢  | 我要投稿


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?[numsl, numsl+1, ..., numsr-1, numsr]?is?ascending?if for all?i?where?l <= i < r,?numsi?< numsi+1. Note that a subarray of size?1?is?ascending.

?

Example 1:

Input: nums = [10,20,30,5,10,50]Output: 65Explanation: [5,10,50] is the ascending subarray with the maximum sum of 65.

Example 2:

Input: nums = [10,20,30,40,50]Output: 150Explanation: [10,20,30,40,50] is the ascending subarray with the maximum sum of 150.

Example 3:

Input: nums = [12,17,15,13,10,11,12]Output: 33Explanation: [10,11,12] is the ascending subarray with the maximum sum of 33.

?

Constraints:

  • 1 <= nums.length <= 100

  • 1 <= nums[i] <= 100

Easy 題目;

遍歷確認(rèn)最大值即可;


Runtime:?0 ms, faster than?100.00%?of?Java?online submissions for?Maximum Ascending Subarray Sum.

Memory Usage:?42.9 MB, less than?5.72%?of?Java?online submissions for?Maximum Ascending Subarray Sum.


LeetCode 1800. Maximum Ascending Subarray Sum的評論 (共 條)

分享到微博請遵守國家法律
宜州市| 康马县| 白沙| 东辽县| 泰州市| 精河县| 应用必备| 博客| 亚东县| 米易县| 商城县| 肥东县| 寿阳县| 中西区| 裕民县| 巫山县| 成武县| 东安县| 琼海市| 察哈| 隆安县| 屏南县| 河北省| 南溪县| 虎林市| 泰安市| 常宁市| 彩票| 无锡市| 日土县| 枞阳县| 东乌| 农安县| 龙川县| 唐河县| 普兰县| 伊宁县| 迭部县| 吴江市| 龙山县| 元阳县|