Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Morse Clock by mangeurdecowan
def checkio(time_string: str) -> str:
result = []
for time in time_string.split(':'):
time = time.zfill(2)
for i, digit in enumerate(time):
morse_bit = bin(int(digit)).replace("0b","").zfill(3+i)
result.append(morse_bit.replace('0', '.').replace('1', '-'))
result.append(':')
return ' '.join(result)[1:-2] #strip first '.' and final ' :'
July 21, 2021
Comments: