Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- int main() {
- std::vector<int> v = {1,2,3,3,4,5};
- auto it = std::unique(v.begin(), v.end());
- std::cout << ((it == v.end()) ? "Unique\n" : "Duplicate(s)\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement