Created
August 28, 2014 03:19
-
-
Save csgregorian/b5b7ff541f93679205c7 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
a = [5,1,4,2,3] | |
b = [2,5,3,1,4] | |
num_shifts = 0 | |
def f(i): | |
global a | |
if a[i] != b[i]: | |
cow = a[b.index(a[i])] | |
a[b.index(a[i])] = a[i] | |
f(b.index(cow)) | |
for i in range(len(a)): | |
f(i) | |
print(a) | |
print(b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment