EASY TO UNDERSTAND | BEGINNER FRIENDLY | 2ms | Beats 100%🥷🏻🔥
IntuitionIterartively check if num1 contains nums2 elements and vice versa.ApproachIterartively check if num1 contains nums2 elements and vice versa.Complexity
# Intuition
Iterartively check if num1 contains nums2 elements and vice versa.
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
Iterartively check if num1 contains nums2 elements and vice versa.
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: O(n+m)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```csharp []
public class Solution {
    public int[] FindIntersectionValues(int[] nums1, int[] nums2) {
        int n1 = 0, n2 =0;

        foreach(int x in nums1){
            if(nums2.Contains(x)){
                n1++;
            }
        }
        foreach(int x in nums2){
            if(nums1.Contains(x)){
                n2++;
            }
        }

        return new int[2] {n1, n2};
    }
}
```
['Array', 'Hash Table', 'Java', 'C#', 'MS SQL Server']