https://leetcode.com/problems/minimum-operations-to-exceed-threshold-value-i/description/
1 2 3 4 5 | class Solution: def minOperations(self, nums: List[int], k: int) -> int: answer = [1 if num < k else 0 for num in nums ] return sum(answer) | cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 3074. Apple Redistribution into Boxes (0) | 2024.04.25 |
---|---|
leetcode 1137. N-th Tribonacci Number (0) | 2024.04.25 |
leetcode 3069. Distribute Elements Into Two Arrays I (0) | 2024.04.24 |
leetcode 3079. Find the Sum of Encrypted Integers (0) | 2024.04.24 |
leetcode 3083. Existence of a Substring in a String and Its Reverse (0) | 2024.04.24 |
댓글