1
class Solution:
2
def minStoneSum(self, piles: List[int], k: int) -> int:
3
heap = [-p for p in piles]
4
heapq.heapify(heap)
5
for _ in range(k):
6
cur = -heapq.heappop(heap)
7
heapq.heappush(heap, -(cur - cur // 2))
8
return -sum(heap)

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0