Skip to content

Commit 0e8386b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 94de189 commit 0e8386b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎greedy_methods/minimize_deviation_in_array.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
"""
22
You are given an array nums of n positive integers.
33
4-
You can perform two types of operations on any
4+
You can perform two types of operations on any
55
element of the array any number of times:
66
77
If the element is even, divide it by 2.
8-
For example, if the array is [1,2,3,4], then you can do this operation
8+
For example, if the array is [1,2,3,4], then you can do this operation
99
on the last element, and the array will be [1,2,3,2].
1010
If the element is odd, multiply it by 2.
1111
For example, if the array is [1,2,3,4], then you can do this operation
1212
on the first element, and the array will be [2,2,3,4].
13-
The deviation of the array is the maximum difference between
13+
The deviation of the array is the maximum difference between
1414
any two elements in the array.
1515
16-
Return the minimum deviation the array can have after performing
16+
Return the minimum deviation the array can have after performing
1717
some number of operations.
1818
"""
1919

2020
from heapq import heapify, heappop, heappush
21-
21+
2222

2323
class Solution:
2424
def minimum_deviation(self, nums) -> int:

0 commit comments

Comments
 (0)