list::unique() is an inbulit function in C++ STL which removes all duplicate consecutive elements from the list. Syntax: list_name.unique(BinaryPredicate name) Parameters:The function accepts a single… Read More »