You are viewing a single comment's thread. Return to all comments →
In the modern HackerRank interface, my Python3 solution uses the in-built insert for lists.
insert
def insertionSort2(n, arr): for i in range(1, n): j = 0 ; key = arr[i] ; del arr[i] while j < i and arr[j] < key : j += 1 arr.insert(j, key) ; print(*arr)
Seems like cookies are disabled on this browser, please enable them to open this website
Insertion Sort - Part 2
You are viewing a single comment's thread. Return to all comments →
In the modern HackerRank interface, my Python3 solution uses the in-built
insert
for lists.