Skip to content

Instantly share code, notes, and snippets.

@tuvo1106
Created July 4, 2019 16:37
Show Gist options
  • Save tuvo1106/13915ef877eea64b83ba5db767be1f46 to your computer and use it in GitHub Desktop.
Save tuvo1106/13915ef877eea64b83ba5db767be1f46 to your computer and use it in GitHub Desktop.
def insertion(l: list):
arr = l[::]
for i in range(len(arr)):
for j in range(i, 0, -1):
if arr[j] < arr[j - 1]:
arr[j], arr[j - 1] = arr[j - 1], arr[j]
return arr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment