Minimum Operations to Make Array Equal LeetCode solution in Python

1
class Solution:
2
def minOperations(self, n: int) -> int:
3

4
return sum([n - x for x in range(n) if x % 2 != 0])

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0