Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Robot Sort by Moff
def swapsort(iterable):
result = []
a = list(iterable)
for i in range(len(a)):
for j in range(len(a) - i - 1):
if a[j] > a[j + 1]:
a[j], a[j + 1] = a[j + 1], a[j]
result.append('{}{}'.format(j, j + 1))
return ','.join(result)
Aug. 8, 2015