Skip to content

Instantly share code, notes, and snippets.

View himmelmaus's full-sized avatar
🥔
Happy about roast potatoes

Elspeth Smith himmelmaus

🥔
Happy about roast potatoes
View GitHub Profile

Keybase proof

I hereby claim:

  • I am findoslice on github.
  • I am findoslice (https://keybase.io/findoslice) on keybase.
  • I have a public key whose fingerprint is 0850 357D 27F9 5B6C D7AC A583 2AC0 AA24 AEE4 7500

To claim this, I am signing this object:

@himmelmaus
himmelmaus / thanos_sort.py
Created March 25, 2019 01:20
A quick implementation of the thanos sort algorithm, removing half of the array's elements at a time until the array is sorted
from random import randint
def thanos_sort(array):
while not is_sorted(array):
target_length = int(len(array)/2)
while len(array) > target_length:
del array[randint(0, len(array)-1)]
return array
def is_sorted(array):