Pratik def minOpers(arr): m = min(arr) n = len(arr) da = [0]*n #dynamic array for i in arr: for j in range(n): req = i-(m-j) req = req//5 + (req%5)//2 + (req%5)%2 da[j]+= req return min(da) Log in to Reply
def minOpers(arr):
m = min(arr)
n = len(arr)
da = [0]*n #dynamic array
for i in arr:
for j in range(n):
req = i-(m-j)
req = req//5 + (req%5)//2 + (req%5)%2
da[j]+= req
return min(da)