Array 3065. Minimum Operations to Exceed Threshold Value I ¶ Time: $O(n)$ Space: $O(1)$ C++JavaPython 1 2 3 4 5 6class Solution { public: int minOperations(vector<int>& nums, int k) { return ranges::count_if(nums, [k](int num) { return num < k; }); } }; 1 2 3 4 5class Solution { public int minOperations(int[] nums, int k) { return (int) Arrays.stream(nums).filter(num -> num < k).count(); } } 1 2 3class Solution: def minOperations(self, nums: list[int], k: int) -> int: return sum(num < k for num in nums)