21
Solution 1: sort + unique C++ 4 lines
vector<int> v = {1, 2, 2, 3, 4, 4, 5};
sort(v.begin(), v.end());
v.erase(unique(v.begin(), v.end()), v.end());
// 1 2 3 4 5
Solution 2: set C++ 1 line
set<int> s(v.begin(), v.end()); // keeps one of each, sorted