Tap here to switch tabs
Problem
Submissions

Problem: Minimum Operations to Exceed Threshold Value I

med
30 min
Try to solve the Minimum Operations to Exceed Threshold Value I problem.

Statement

You are given a 00 indexed integer array nums and an integer k.

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

Return the minimum number of operations required so that every element in nums is greater than or equal to k.

Constraints:

  • 1≤1 \leq nums.length ≤50\leq 50

  • 1≤1 \leq nums[i] ≤109\leq 10^9

  • 1≤1 \leq k ≤109\leq 10^9

  • The input is generated such that there is at least one index i such that nums[i] ≥\geq k.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Operations to Exceed Threshold Value I

med
30 min
Try to solve the Minimum Operations to Exceed Threshold Value I problem.

Statement

You are given a 00 indexed integer array nums and an integer k.

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

Return the minimum number of operations required so that every element in nums is greater than or equal to k.

Constraints:

  • 1≤1 \leq nums.length ≤50\leq 50

  • 1≤1 \leq nums[i] ≤109\leq 10^9

  • 1≤1 \leq k ≤109\leq 10^9

  • The input is generated such that there is at least one index i such that nums[i] ≥\geq k.