Skip to content

Instantly share code, notes, and snippets.

@chasefloyd
Created November 1, 2017 18:32
Show Gist options
  • Save chasefloyd/caf4517671f60c6f79fc7b1c377f07d7 to your computer and use it in GitHub Desktop.
Save chasefloyd/caf4517671f60c6f79fc7b1c377f07d7 to your computer and use it in GitHub Desktop.
Python solution for inversing lists
def inverse(A, B, f):
x = []
for i in range(len(f)):
x.append(f[i][::-1])
return x
A = [1, 2, 3]
B = [1, 5, 6]
f = [[1, 4], [2, 5], [3, 6]]
print(inverse(A, B, f))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment