Intersection of array

cin >> n;
int temp;
for (int i = 0; i < n; i++)
{
cin >> temp;
freq[temp]++;
}

    if (freq.find(temp) != freq.end() && freq[temp] > 0)
    what is the exact meaning of above code?

@dips123deepali_c25f140838182212 first u are taking input then inserting to map
eg input is 1 1 2 3 3 3 3
map will look like
1 --> 2
2 --> 1
3 --> 4
the if condition is checking if the element(temp) is present and freq of that element (temp) is not zero

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.