Easy Video Explanation For Beginners || C++,JAVA,Python
Easy Video Explanation\n\nhttps://youtu.be/nQham65n3Zw\n\n# Approach\n Describe your approach to solving the problem. \nThe code finds the intersection values b
***Easy Video Explanation***\n\nhttps://youtu.be/nQham65n3Zw\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nThe code finds the intersection values between two vectors (lists in Python and ArrayLists in Java), counting occurrences in both directions. The result is a list with two counts: the first represents common values from the first vector in the second, and the second count vice versa.\n\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(N*N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(1)\n\n# Code\n\n\n```C++ []\nclass Solution {\npublic:\n    vector<int> findIntersectionValues(vector<int>& v1, vector<int>& v2) {\n        int c=0;\n        vector<int>ans;\n        for(auto i:v1)\n        {\n            for(auto j:v2)\n            {\n                if(i==j)\n                {\n                    c++;\n                    break;\n                }\n            }\n        }\n        ans.push_back(c);\n        c=0;\n        for(auto i:v2)\n        {\n            for(auto j:v1)\n            {\n                if(i==j)\n                {\n                    c++;\n                    break;\n                }\n            }\n        }\n        ans.push_back(c);\n        return ans;\n    }\n};\n```\n```python []\nclass Solution:\n    def find_intersection_values(self, v1, v2):\n        c = 0\n        ans = []\n        for i in v1:\n            for j in v2:\n                if i == j:\n                    c += 1\n                    break\n        ans.append(c)\n        c = 0\n        for i in v2:\n            for j in v1:\n                if i == j:\n                    c += 1\n                    break\n        ans.append(c)\n        return ans\n\n```\n```Java []\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class Solution {\n    public List<Integer> findIntersectionValues(List<Integer> v1, List<Integer> v2) {\n        int c = 0;\n        List<Integer> ans = new ArrayList<>();\n        for (int i : v1) {\n            for (int j : v2) {\n                if (i == j) {\n                    c++;\n                    break;\n                }\n            }\n        }\n        ans.add(c);\n        c = 0;\n        for (int i : v2) {\n            for (int j : v1) {\n                if (i == j) {\n                    c++;\n                    break;\n                }\n            }\n        }\n        ans.add(c);\n        return ans;\n    }\n}\n\n\n```\n\n# ***If you like the solution Please Upvote and subscribe to my youtube channel***\n***It Motivates me to record more videos***\n\n*Thank you* \uD83D\uDE00
['C++']