Skip to content

Instantly share code, notes, and snippets.

@amosboldor
Created December 15, 2016 18:47
Show Gist options
  • Save amosboldor/e1888c6a49656f2592c21315d95cf51d to your computer and use it in GitHub Desktop.
Save amosboldor/e1888c6a49656f2592c21315d95cf51d to your computer and use it in GitHub Desktop.
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
@nhuntwalker
Copy link

Solid. I like it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment