Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Oneliner_lambda solution in Clear category for Common Words by nazarstakhovskyi
checkio = lambda line1, line2: ",".join(sorted([i for i in line1.split(",") if i in line2.split(",")]))
if __name__ == '__main__':
print("Example:")
print(checkio('hello,world', 'hello,earth'))
# These "asserts" are used for self-checking and not for an auto-testing
assert checkio('hello,world', 'hello,earth') == 'hello'
assert checkio('one,two,three', 'four,five,six') == ''
assert checkio('one,two,three',
'four,five,one,two,six,three') == 'one,three,two'
print("Coding complete? Click 'Check' to earn cool rewards!")
June 30, 2021
Comments: