👨🏻‍💻✅✅EASY CODE || Python , Java ✅✅
LogicJava\nCount the number of intersecting elements between two arrays. It converts one array into an ArrayList for efficient lookups and checks if elements fr
# Logic```Java```\nCount the number of intersecting elements between two arrays. It converts one array into an ArrayList for efficient lookups and checks if elements from the other array are present. Similarly, it counts the intersecting elements in the reverse direction. The counts are then stored in an integer array and returned.\n# Code\n```java []\nimport java.util.ArrayList;\nclass Solution {\n    public int[] findIntersectionValues(int[] nums1, int[] nums2) {\n        int ans1 = 0, ans2 = 0;\n        ArrayList<Integer> arr = new ArrayList<>();\n        ArrayList<Integer> list2 = new ArrayList<>();\n        for(int n:nums2){\n            list2.add(n);\n        }\n        for(int i=0;i<nums1.length;i++){\n            if(list2.contains(nums1[i])){\n                ans1++;\n            }\n        }\n        ArrayList<Integer> list1 = new ArrayList<>();\n        for(int n:nums1){\n            list1.add(n);\n        }\n        for(int i=0;i<nums2.length;i++){\n            if(list1.contains(nums2[i])){\n                ans2++;\n            }\n        }\n        arr.add(ans1); arr.add(ans2);\n        int[] result = new int[arr.size()];\n        for(int i=0;i<arr.size();i++){\n            result[i] = arr.get(i);\n        }\n        return result;\n    }\n}\n```\n# Logic ```Python```\nCount how many elements from one list appear in the other and vice versa. It iterates through each list, checks for membership in the other list, and updates counters accordingly. The final counts are stored in a list and returned. This approach directly utilizes Python\'s list operations for simplicity.\n# Code\n```python []\nclass Solution:\n    def findIntersectionValues(self, nums1: List[int], nums2: List[int]) -> List[int]:\n        ans1,ans2=0,0\n        for i in range(len(nums1)):\n            if(nums1[i] in nums2):\n                ans1+=1\n        for i in range(len(nums2)):\n            if(nums2[i] in nums1):\n                ans2+=1\n        answers=[ans1,ans2]\n        return answers\n```\n---\n# PLS UPVOTE \u2B06\uFE0F\u2B06\uFE0F\n---
['Array', 'Java', 'Python3']