Всем привет.
Вход:
s = [2, 6, 6, 9, 11, 11, 12, 12, 12, 13, 14, 16, 18, 18, 18, 99]
Выход:
s = [1, 2, 2, 3, 4, 4, 5, 5, 5, 6, 7, 8, 9, 9, 9, 10]
from collections import Counter
dup = [x for x, count in Counter(s).items() if count > 1]
Спасибо.
Всем привет.
Вход:
s = [2, 6, 6, 9, 11, 11, 12, 12, 12, 13, 14, 16, 18, 18, 18, 99]
Выход:
s = [1, 2, 2, 3, 4, 4, 5, 5, 5, 6, 7, 8, 9, 9, 9, 10]
from collections import Counter
dup = [x for x, count in Counter(s).items() if count > 1]
Спасибо.