We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 469d723 commit ed58ca6Copy full SHA for ed58ca6
LC_1402.py
@@ -0,0 +1,9 @@
1
+class Solution:
2
+ def maxSatisfaction(self, satisfaction: List[int]) -> int:
3
+ A = satisfaction
4
+ res = total = 0
5
+ A.sort()
6
+ while A and A[-1] + total > 0:
7
+ total += A.pop()
8
+ res += total
9
+ return res
0 commit comments