set1装一个数组全部元素,set2存储重复元素,然后将set2元素赋值到一个数组中返回
class Solution {
public int[] intersection(int[] nums1, int[] nums2) {
int len =nums1.length set1=new HashSet();
Set set2=new HashSet();
for(int i=0;i 
set1装一个数组全部元素,set2存储重复元素,然后将set2元素赋值到一个数组中返回
class Solution {
public int[] intersection(int[] nums1, int[] nums2) {
int len =nums1.length set1=new HashSet();
Set set2=new HashSet();
for(int i=0;i