HashMap Easy
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] findIntersectionValues(int[] nums1, int[] nums2) {\n        int[] ans = new int[2];\n        HashMap<Integer,Integer> map1 = new HashMap<>();\n        HashMap<Integer,Integer> map2 = new HashMap<>();\n        for(int i = 0;i<nums1.length;i++){\n            map1.put(nums1[i],map1.getOrDefault(nums1[i],0)+1);\n        }\n        for(int i=0;i<nums2.length;i++){\n            map2.put(nums2[i],map2.getOrDefault(nums2[i],0)+1);\n            \n        }\n        int count1 = 0;\n        //check for nums1\n        for(int i=0;i<nums1.length;i++){\n            if(map2.containsKey(nums1[i]) && map2.get(nums1[i])>=1){\n                count1++;\n            }\n        }\n        ans[0] = count1;\n        int count_2 = 0;\n        for(int i=0;i<nums2.length;i++){\n            if(map1.containsKey(nums2[i]) && map2.get(nums2[i])>=1){\n                count_2++;\n            }\n        }\n        ans[1] = count_2;\n        return ans;\n    }\n}\n```
['Java']