Skip to content

Instantly share code, notes, and snippets.

@wallstop
Created March 4, 2014 03:46
Show Gist options
  • Save wallstop/9339939 to your computer and use it in GitHub Desktop.
Save wallstop/9339939 to your computer and use it in GitHub Desktop.
alphabet = "abcdefghijklmnopqrstuvwxzy"
masterSet = list()
def generateSet():
global masterSet
masterSet.clear()
basis = list(alphabet)
masterSet = list(alphabet)
for i in range(0, 26):
newList = list()
for element in basis:
for character in alphabet:
if(ord(character[0]) > ord(element[-1])):
masterSet.append(element + character[0])
newList.append(element + character[0])
basis = newList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment