Created
October 7, 2013 19:35
-
-
Save AlexFrazer/6873629 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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