Created
December 15, 2016 18:47
-
-
Save amosboldor/e1888c6a49656f2592c21315d95cf51d 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
def find_the_ball(pos, swaps): | |
for swap in swaps: | |
if swap[0] == pos: | |
pos = swap[1] | |
elif swap[1] == pos: | |
pos = swap[0] | |
return pos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solid. I like it.