A = [12, 28, 46, 32, 50]
B = [50, 12, 32, 46, 28]
class Solution(object):
def anagramMappings(self, A, B):
"""
:type A: List[int]
:type B: List[int]
:rtype: List[int]
"""
C = []
for num in A:
C.append(B.index(num))
return C
Sol = Solution()
print Sol.anagramMappings(A,B)
0,比较简单的题目。
1,主要还是用到了index返回元素所在下标的方法。