You are viewing a single comment's thread. Return to all comments →
Here's another, slightly condensed Python3 solution
s = int(input().strip()) ar = [int(temp) for temp in input().strip().split(' ')] def insertionSort(ar, i): new = sorted(ar[:i+1]) + ar[i+1:] return ' '.join(str(k) for k in new) for i in range(1, s): print(insertionSort(ar, i))
Insertion Sort - Part 2
You are viewing a single comment's thread. Return to all comments →
Here's another, slightly condensed Python3 solution