def minimum_swaps(ratings):
cr = ratings.copy()
for i,x in enumerate(ratings):
max_x = max(ratings)
idx = ratings.index(max_x)
#print(i, idx, max_x, cr)
if 1 : #idx+i<=len(cr):
print(max_x,i,idx,cr,ratings)
cr[i]=max_x
cr[idx+i]=ratings[0]
ratings = cr[i::]
del ratings[0]
print(ratings)
print(minimum_swaps([8,3,9,1,5]))