Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
9-liner: sort by characters & maintain the NEW order solution in Clear category for Determine the Order by Stensen
def checkio(words):
chars, result = sorted(set(''.join(words))), ''
chars_len = len(chars)
while len(result) < chars_len:
for char in chars:
if all(char not in word or word[0] == char for word in words):
words = list(filter(None, map(lambda i: i.replace(char, ''), words)))
chars.remove(char); result += char; break
return result
Nov. 18, 2020
Comments: