美团笔试4.9第二题
大佬们能否帮忙小弟看一眼,第二题感觉思路很简单,为什么一直AC0!!!
n = int(input())
A = list(map(int, input().split(' ')))
B = list(map(int, input().split(' ')))
if n <= 1:
print(0)
else:
hash = {}
for i in range(n):
hash[A[i]] = i
minval = hash[B[-1]]
count = 0
for i in range(n-2, -1, -1):
index = hash[B[i]]
if index > minval:
count += 1
else:
minval = index
print(count)
深信服公司福利 830人发布