题解 | #记票统计#
记票统计
https://www.nowcoder.com/practice/3350d379a5d44054b219de7af6708894
num = int(input().strip())
table1 = list(map(str,input().strip().split(" ")))
num2 = int(input().strip())
table2 = list(map(str,input().strip().split(" ")))
retable,miscount = {},0
for i in table1:
retable[i] = 0
for j in table2:
try:
retable[j] +=1
except:
miscount +=1
for i in table1:
print(i,':',retable[i])
print(f'Invalid : {miscount}')

SHEIN希音公司福利 257人发布