There was an error while loading. Please reload this page.
1 parent 614dbce commit b4e4deeCopy full SHA for b4e4dee
Oct-14-24.py
@@ -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