🎉Beats 96.68% Users🎉 || Simplest Solution: Using ONLY ARRAY || JAVA
\n\n\n# Complexity\n- Time complexity: o(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: o(n)\n Add your space complexity here, e.g. O(n) 
![image.png](https://assets.leetcode.com/users/images/8acb03e4-43a6-4a5e-954d-aebff09cf08e_1720275747.1181247.png)\n\n\n# Complexity\n- Time complexity: o(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: o(n)\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[] res = new int[2];\n        int[] num1 = new int[101];\n        int[] num2 = new int[101];\n\n        for (int i : nums1)\n            num1[i]++;\n\n        for (int j : nums2)\n            num2[j]++;\n\n        for (int i = 1; i < 101; i++) {\n            if (num1[i] != 0 && num2[i] != 0) {\n                res[0] += num1[i];\n                res[1] += num2[i];\n            }\n        }\n        return res;\n    }\n}\n```\n![Upvote me.png](https://assets.leetcode.com/users/images/02a4e23a-9715-457e-85d2-15d9dd9b713b_1720275811.1955473.png)\n
['Array', 'Counting', 'Java']