3065. Minimum Operations to Exceed Threshold Value I
Read the full problem statement on LeetCode.
Difficulty: easy Acceptance: 86% Topics: Array
View full problem on LeetCode Reading material
Reference solution (spoiler · python)
# Time: O(n)
# Space: O(1)
# array
class Solution(object):
def minOperations(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: int
"""
return sum(x < k for x in nums)
Solution from kamyu104/LeetCode-Solutions · MIT