Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Robot Sort by fed.kz
def swapsort(array):
array = list(array)
count = 0
answer = []
while count != len(array) - 1:
if array[count] > array[count+1]:
array[count], array[count+1] = array[count+1], array[count]
answer.append(f'{count}{count+1}')
count = 0
else:
count += 1
return ','.join(answer)
Nov. 19, 2018