Skip to content

Instantly share code, notes, and snippets.

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