quick codes for frequent needs
//numbers = str //string = list
string = list(map(int, numbers.split()))
or
nums = sorted(numbers.split(), key=int)
a = [2,0,1,2] #bidid b = [8,7,6,9] #bidcost c = set(a)
dis = {} l = list for i in range(len(a)): if a[i] in c: if b[i]<b[i-1]: dis[a[i]] = b[i]
print(dis) sum = 0 for i in dis.keys(): sum = sum+dis[i] print(sum)