Skip to content

Commit 1519cb9

Browse files
committed
Runtime: 2571 ms (Top 53.06%) | Memory: 28.4 MB (Top 82.81%)
1 parent 055316e commit 1519cb9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/algorithms/M/Maximum Alternating Subsequence Sum/Maximum Alternating Subsequence Sum.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Runtime: 2571 ms (Top 53.06%) | Memory: 28.4 MB (Top 82.81%)
12
class Solution:
23
def maxAlternatingSum(self, nums: List[int]) -> int:
34
ans = 0
@@ -12,4 +13,4 @@ def maxAlternatingSum(self, nums: List[int]) -> int:
1213
direction = 'down'
1314
if direction == 'up':
1415
return ans
15-
return ans + nums[-1]
16+
return ans + nums[-1]

0 commit comments

Comments
 (0)