Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Third solution in Clear category for Robot Sort by gyahun_dash
def swapsort(rods):
array = list(rods)
operations = []
for top in range(len(array)):
argmin = array.index(min(array))
operations += [(i - 1, i) for i in range(top + argmin, top, -1)]
array.pop(argmin)
return ','.join('{}{}'.format(*op) for op in operations)
July 10, 2014
Comments: