Skip to content

Commit b4e4dee

Browse files
committed
2530
1 parent 614dbce commit b4e4dee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Oct-14-24.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution:
2+
def maxKelements(self, nums: List[int], k: int) -> int:
3+
nums = [-i for i in nums]
4+
heapq.heapify(nums)
5+
sc = 0
6+
while k>0:
7+
ele = -heapq.heappop(nums)
8+
sc += ele
9+
heapq.heappush(nums,-math.ceil(ele/3))
10+
k -= 1
11+
return sc

0 commit comments

Comments
 (0)