You are viewing a single comment's thread. Return to all comments →
Python Solution:
def minimumLoss(price): arr = sorted(enumerate(price), key=lambda x: x[1], reverse=True) diff = [arr[i][1] - arr[i + 1][1] for i in range(len(arr) - 1) if arr[i][0] < arr[i + 1][0]] return max(min(diff), 0)
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Loss
You are viewing a single comment's thread. Return to all comments →
Python Solution: