Skip to content

Instantly share code, notes, and snippets.

@GonzaloAlvarez
Last active March 22, 2021 16:45
Show Gist options
  • Save GonzaloAlvarez/157e7963ef73987a5585 to your computer and use it in GitHub Desktop.
Save GonzaloAlvarez/157e7963ef73987a5585 to your computer and use it in GitHub Desktop.
First time, first fail
# 1: Define alphabet:
a = range(255)
# 2: Letter count:
n = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0)
# 3: Merge to dictionary:
d = { x: y for x, y in zip(a,n) }
# 4: 'Initialize' characters
l = ''.join([chr(c) *n for c,n in d.items()])
# 5: Define the order of the characters, initialize final string
# and sort before outputting:
z = [6,5,0,7,11,1,2,3,4,8,9]
o = [0] * 13
for c in l:
i = z.pop(0)
o[i] = c
print ''.join(o)
@boki113
Copy link

boki113 commented Mar 22, 2021

Lukas R., nicht nachschauen! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment