KK
Size: a a a
KK
MF
MF
KK
RB
RB
KK
SA
SA
RB
from functools import reduce
def reducer(acc, el):
if el not in acc:
acc.append(el)
return acc
def pure_reducer(acc, el):
if el not in acc:
return [*acc, el]
return [*acc]
if __name__ == "__main__":
dicts = [{"a": 1}, {"a": 1, "b": 2}, {"a": 1, "b": 2}, {"a": 1, "b": 2, "c": 3}]
print(reduce(reducer, dicts, []))
print(reduce(pure_reducer, dicts, []))
SA
KK
RB
SA
KK
РГ
РГ
RB
in
РГ