📜  从列表 python 列表中删除重复项 - TypeScript 代码示例

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

代码示例3
k = [[1, 2], [4], [5, 6, 2], [1, 2], [3], [4]]
new_k = []
for elem in k:
    if elem not in new_k:
        new_k.append(elem)
k = new_k
print k
# prints [[1, 2], [4], [5, 6, 2], [3]]