Java || 100% Beats || Easy to Understand
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:O(n)\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[] output = new int[2];\n        int count = 0;\n        HashSet<Integer> numSet = new HashSet<>();\n        for(int x : nums1) numSet.add(x);\n        for(int x : nums2) if(numSet.contains(x)) count++;\n        output[1] = count;\n        numSet.clear(); count = 0;\n        for(int x : nums2) numSet.add(x);\n        for(int x : nums1) if(numSet.contains(x)) count++;\n        output[0] = count;\n        return output;\n    }\n}\n```
['Java']