About
def rodOffcut(lengths): arr=[] while(len(lengths)>0): arr.append(len(lengths)) min=10000 count=0 for i in lengths: if i<min: min=i for i in range(len(lengths)): if lengths[i]==min: count=count+1 for i in range(count): lengths.remove(min) for i in range(len(lengths)): lengths[i]=lengths[i]-min return arr