
[LeetCode] 3066. Minimum Operations to Exceed Threshold Value II (Python)
·
알고리즘/LeetCode
난이도: Medium문제 설명You are given a 0-indexed integer array nums, and an integer k. In one operation, you will: Take the two smallest integers x and y in nums.Remove x and y from nums.Add min(x, y) * 2 + max(x, y) anywhere in the array. Note that you can only apply the described operation if nums contains at least two elements. nums. Return the minimum number of operations needed so that all element..