I have string
value as:
s = 'asdabbdasfababbabb'
I've split the str
by using below code, than get result as below :
n = 3
split_strings = [s[index : index + n] for index in range(0, len(s), n)]
['asd', 'abb', 'das', 'fab', 'abb', 'abb']
What I need to achieve:
I want to count duplicated value consiering the sequence such as :
({'asd': 1, 'abb': 1, 'das': 1, 'fab': 1, 'abb' : 2})
However, if I use Counter()
it counts the duplicated value but, does not seems to consider the sequence of list:
Counter({'asd': 1, 'abb': 3, 'das': 1, 'fab': 1})
How can I achieve what I need?