# 350. Intersection of Two Arrays II
https://leetcode.com/problems/intersection-of-two-arrays-ii
參考網站
https://blog.csdn.net/sinat_28576553/article/details/99131954
思路:
1. 內建函市庫的collection.counter 基本上就是hash table 的製作, 所以我們手刻出一個hash table ,
2. 要注意的是,如果你的key值不在dictionary 裏面,會報錯,所以奧先用一個if statement 去判斷。
```python=
class Solution:
def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]:
dic={}
list=[]
for i in nums1:
if i not in dic:
dic[i]=1
else:
dic[i]+=1
for j in nums2:
#j=int(j)
if j in dic:
if dic[j]>0:
list.append(j)
dic[j]-=1
return list
```