1class Solution:2 def maximumProduct(self, nums: List[int], k: int) -> int:3 heap = nums.copy()4 heapify(heap)5 for i in range(k):6 t = heappop(heap)7 heappush(heap, t + 1)8 ans = 19 mod = 100000000710 for i in heap:11 ans = (ans * i) % mod12 return ans
WPM •0 •0
ACC •0 •0
TIME •0