3331. Minimum Operations to Exceed Threshold Value I
My accepted C++ solution to LeetCode problem 3331, Minimum Operations to Exceed Threshold Value I, running in 0ms.
- Difficulty: Easy
- C++
- Runtime 0ms
- Memory 24.9MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
C++
Accepted on LeetCode — runtime 0ms, memory 24.9MB, accepted 2025-12-27.
class Solution {
public:
int minOperations(vector<int>& nums, int k) {
int count = 0;
for (int n : nums) {
if (n < k) count++;
}
return count;
}
};