Given two arrays, write a function to compute their intersection.
Example:
Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].
Note:
Each element in the result must be unique.
The result can be in any order.
给定两个数组,求数组的交集。输出结果中的元素唯一,输出数组可以无序。
public int[] intersection(int[] nums1, int[] nums2) {
int j = 0;
int[] temp = new int[nums2.length];