Skip to content

Commit f5198f1

Browse files
authored
Create minimum-operations-to-exceed-threshold-value-i.py
1 parent 63ca117 commit f5198f1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Time: O(n)
2+
# Space: O(1)
3+
4+
# array
5+
class Solution(object):
6+
def minOperations(self, nums, k):
7+
"""
8+
:type nums: List[int]
9+
:type k: int
10+
:rtype: int
11+
"""
12+
return sum(x < k for x in nums)

0 commit comments

Comments
 (0)