Nov-25-2020, 04:13 PM
Hi,
My code is meant to go through list 't' and check if any object from it is smaller than the first object in list 'a', if there is one, than it changes the value to '100001' which is just a sign to me that its already used, and than it goes to the next object in list 'a' and does that until it goes through the whole list 'a'. Also the values from list 't' can only be used once each. Does anyone have an idea or a clue on how to optimize or speed up this code?
My code is meant to go through list 't' and check if any object from it is smaller than the first object in list 'a', if there is one, than it changes the value to '100001' which is just a sign to me that its already used, and than it goes to the next object in list 'a' and does that until it goes through the whole list 'a'. Also the values from list 't' can only be used once each. Does anyone have an idea or a clue on how to optimize or speed up this code?
for k in range(m): u=0 for u in range(n): if t[u]<a[k]: t[u]=100001 a[k]=100001 l+=1 break