📜  删除连续重复python代码示例

📅  最后修改于: 2022-03-11 14:46:10.427000             🧑  作者: Mango

代码示例1
def remove_consecutive_duplicates(_list: list):
    preprocessed_list = []
    for x in itertools.groupby(_list):
        preprocessed_list.append(x[0])

    return preprocessed_list