3
// what i think is we have to return the intersection elements from both nums4
vector<int> intersection(vector<int> &nums1, vector<int> &nums2) {5
// result vector which will store those values which will be intersecting in9
// map intersection, which will store values of all the elements in num110
unordered_map<int, int> intersection;12
// map will store all the values of num1(as key),with corresponding value 113
for (auto character : nums1) {14
intersection[character] = 1;17
// this loop will check if any element of num1 is there in num2? if yes,18
// insert it in result after inserting it once, make its corresponding value19
// to 0 so that if you find any elements, that is repeating in num2, as well20
// as present in num1 so you dont enter it twice in result, you should enter22
for (auto character : nums2) {23
// if found once, it's value would be 1, so entered in result24
// after it is entered in result, its value we change to 025
// so agin if that same element repeats, due to 0 as its value, we avoid26
// pushing it to result27
if (intersection[character]) {28
result.push_back(character);29
intersection[character] = 0;33
// after getting all the intersecting elements,we return result