Skip to content

Commit a28f71e

Browse files
committed
v1: error 忘记sort了又。。。
1 parent fc508de commit a28f71e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'''
2+
Author: LetMeFly
3+
Date: 2024-01-18 19:32:37
4+
LastEditors: LetMeFly
5+
LastEditTime: 2024-01-18 19:34:06
6+
'''
7+
from typing import List
8+
9+
class Solution:
10+
def minimumRemoval(self, beans: List[int]) -> int:
11+
all_ = sum(beans)
12+
ans = all_
13+
for i, thisBean in enumerate(beans):
14+
ans = min(ans, all_ - thisBean * (len(beans) - i))
15+
return ans

0 commit comments

Comments
 (0)