Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
set().union(*others) solution in Clear category for Determine the Order by David_Jones
def checkio(data):
ordered_symbols = ''
symbols = sorted(set().union(*data))
for _ in range(len(symbols)):
for ch in symbols:
if (
ch not in ordered_symbols
and all(ch not in word or ch == word[0] for word in data)
):
ordered_symbols += ch
for i in range(len(data)):
data[i] = data[i].replace(ch, '')
break
return ordered_symbols
June 24, 2019