Are All Elements Unique?
mediumQuestion 473Write a function bool allUnique(const vector<int>& v) that returns true if no value appears more than once in v and false if any value repeats. An empty vector counts as unique.
The test prints unique when your function returns true and duplicates when it returns false.
Do NOT write a main function.
Expected output
unique duplicates
= newline. The output ends with a newline, so print one after the last line.
Hints2 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.