Skip to content

Instantly share code, notes, and snippets.

@AlexFrazer
Created October 7, 2013 19:35
Show Gist options
  • Save AlexFrazer/6873629 to your computer and use it in GitHub Desktop.
Save AlexFrazer/6873629 to your computer and use it in GitHub Desktop.
import sys
from collections import deque
queue=deque([])
k=int(sys.argv[1])
for line in sys.stdin:
queue.append(line)
#behold my python black magic
for x in reversed(queue):
if x==k: print queue[x]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment