Maximum Score From Removing Stones LeetCode solution in Python

1
class Solution:
2
def maximumScore(self, a: int, b: int, c: int) -> int:
3
a, b, c = sorted([a, b, c], reverse=True)
4
ans = 0
5
while a > 0 and b > 0:
6
a -= 1
7
b -= 1
8
ans += 1
9
a, b, c = sorted([a, b, c], reverse=True)
10
return ans

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0