Answers for "how to remove consecutive duplicates in string in python"

1

remove consecutive duplicates python

def remove_consecutive_duplicates(_list: list):
    preprocessed_list = []
    for x in itertools.groupby(_list):
        preprocessed_list.append(x[0])

    return preprocessed_list
Posted by: Guest on February-23-2020

Code answers related to "how to remove consecutive duplicates in string in python"

Python Answers by Framework

Browse Popular Code Answers by Language