easy-Code | cpp 🤩
Complexity

Time complexity:
O(n2)


Space complexity:
O(1)

Code
# Complexity
- Time complexity:
$$O(n^2)$$

- Space complexity:
$$O(1)$$

# Code
```cpp []
class Solution {
public:
    vector<int> findIntersectionValues(vector<int>& nums1, vector<int>& nums2) {
        int answer1 = 0, answer2 = 0;
        for (int i = 0; i < nums1.size(); ++i) {
            for (int j = 0; j < nums2.size(); ++j) {
                if (nums1[i] == nums2[j]) {
                    answer1++;
                    break;
                }
            }
        }

        for (int i = 0; i < nums2.size(); ++i) {
            for (int j = 0; j < nums1.size(); ++j) {
                if (nums2[i] == nums1[j]) {
                    answer2++;
                    break;
                }
            }
        }

        return {answer1, answer2};
    }
};
```
['Array', 'C++']