Skip to content

Commit 1314654

Browse files
committed
Update 2874. Maximum Value of an Ordered Triplet II.py
1 parent 520403d commit 1314654

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Python_Daily_Solutions/2874. Maximum Value of an Ordered Triplet II/2874. Maximum Value of an Ordered Triplet II.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
class Solution:
44
def maximumTripletValue(self, nums: List[int]) -> int:
55
ans = mx = mx_diff = 0
6-
for x in nums:
6+
for x in nums:
77
ans = max(ans, mx_diff * x)
88
mx_diff = max(mx_diff, mx - x)
9-
mx = m
9+
mx = max(mx, x)
10+
return ans

0 commit comments

Comments
 (0)