Use of Unique iterator in C++
array.erase(unique(array.begin(), array.end()), array.end());
The line of code you provided:
array.erase(unique(array.begin(), array.end()), array.end());
This code is a common idiom used in C++ to remove duplicate elements from a sorted container, ...
sanjhiar2133.hashnode.dev1 min read