[LeetCode] Minimum Operations to Exceed Threshold Value II

3066. Minimum Operations to Exceed Threshold Value II

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.

Return the minimum number of operations needed so that all elements of the array are greater than or equal to k.

Read more
[LeetCode] Minimum Operations to Exceed Threshold Value I

3065. Minimum Operations to Exceed Threshold Value I

You are given a 0-indexed integer array nums, and an integer k.

In one operation, you can remove one occurrence of the smallest element of nums.

Return the minimum number of operations needed so that all elements of the array are greater than or equal to k.

Read more
[Codeforces] Round 488 by NEAR (Div. 1) C. Careful ManeuveringRead more
[Codeforces] Round 492 (Div. 1) [Thanks, uDebug!] A. TeslaRead more
[Codeforces] Educational Round 46 (Rated for Div. 2) E. We Need More BossesRead more
[Codeforces] Round 494 (Div. 3) E. Tree ConstructingRead more
[Codeforces] Round 496 (Div. 3) F. Berland and the Shortest PathsRead more
[Hacker Earth] LADDER RIDERead more
[Hacker Earth] Ikshu`s love for binary numbersRead more
[Hacker Earth] Ikshu and his classRead more