We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defminimumLoss(price):# Write your code heren=len(price)temp={}foriinrange(n):temp[price[i]]=isorted_prices=sorted(price)minimum_loss=Noneforiinrange(n-1):iftemp[sorted_prices[i+1]]<temp[sorted_prices[i]]:loss=sorted_prices[i+1]-sorted_prices[i]ifnotminimum_lossorloss<minimum_loss:minimum_loss=lossreturnminimum_loss
Minimum Loss
You are viewing a single comment's thread. Return to all comments →