Skip to content

Instantly share code, notes, and snippets.

@oten oten/

Created Mar 27, 2017
What would you like to do?
def look_and_say(numbers):
if len(numbers) == 1:
return '1' + numbers
say = 1
out = ''
numbers += 'X'
for curr, _next in zip(numbers, numbers[1:]):
if curr == _next:
say += 1
out += str(say)
out += curr
say = 1
return out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.