Here\'s a Python implementation of insertion sort, I tried to follow the values on paper but once the counting variable i gets bigger than len(s) I don\'t know what to do, h
def insertion(x): for i in range(1, len(x)): while x[i - 1] > x[i] and i >= 0: x[i - 1], x[i] = x[i], x[i - 1] i -= 1 return x
Something like that