Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Robot Sort by kurosawa4434
def swapsort(array):
wk_ary = list(array)
result = ''
err = True
while err:
err = False
for i in range(len(wk_ary) - 1):
if wk_ary[i] > wk_ary[i + 1]:
wk_ary[i], wk_ary[i + 1] = wk_ary[i + 1], wk_ary[i]
result += str(i) + str(i + 1) + ','
err = True
return result[:-1]
July 24, 2016
Comments: