Skip to content

Instantly share code, notes, and snippets.

@CamDavidsonPilon
Created August 19, 2017 16:59
Show Gist options
  • Save CamDavidsonPilon/626c4732e175717f8a8b0e6eb0254c39 to your computer and use it in GitHub Desktop.
Save CamDavidsonPilon/626c4732e175717f8a8b0e6eb0254c39 to your computer and use it in GitHub Desktop.
from collections import deque
def sequence():
queue = deque([3,3,3,2])
yield queue.popleft()
while True:
value = queue.popleft()
queue.extend([3] * value + [2])
yield value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment