We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
definsertionSort2(n,arr):# Write your code here in pythonforiinrange(1,n):forjinrange(i-1,-1,-1):ifarr[i]<arr[j]:arr[i],arr[j]=arr[j],arr[i]i-=1print(*arr)returnarr
Cookie support is required to access HackerRank
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 →