Count Newly Inserted Values
mediumQuestion 465Write a function int insertAll(set<int>& s, const vector<int>& v) that inserts every element of v into s and returns how many of those insertions actually added a new element.
For example, if s starts as {5} and v is {1, 5, 2, 3, 1}, the function returns 3.
Do NOT write a main function.
Expected output
3 0
= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
STL ContainersSets
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.