Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple solution in Clear category for Determine the Order by Sim0000
def checkio(data):
alphabet = sorted(set(''.join(data))) # unique alphabet
result = ''
for n in range(len(alphabet)):
# find minimum
for c in alphabet:
if c in result: continue # already used
if all(c not in word or c == word[0] for word in data): break # found
result += c
# remove c from data
for i in range(len(data)): data[i] = data[i].replace(c, '')
return result
#These "asserts" using only for self-checking and not necessary for auto-testing
May 5, 2014
Comments: