int arr[] = {1, 2, 2, 3, 3, 3, 4, 4, 5}; int size = sizeof(arr) / sizeof(*arr); deleteDuplicates(arr, size); // Output: {1, 2, 3, 4, 5}
std::listThe deleteDuplicates function is not part of the C++ standard library, but it is commonly included in various utility libraries that offer data manipulation functions. It may also be implemented as part of a custom data structure class.list = {10, 10, 20, 30, 30, 30, 40, 50}; list.remove_duplicates(); // Output: {10, 20, 30, 40, 50}