Suppose I have the following list:
l = {"A", "A", "A", "E", "D", "D", "D", "C", "B", "E", "E", "E", "D",
"B", "A", "D", "B", "E", "C", "A", "D", "A", "A", "A", "A", "C",
"C", "C", "D", "D", "E"}
I want to count how many two letters I have namely how many AA, AB,... I have in list l
.
I know this is equivalent of counting the tuples on list l
, the tuples are,
Tuples[l // DeleteDuplicates // Sort, 2]
but I am not sure how to count these on l
. As an example, there are 5 counts of AA on l
. I wonder what is the solution for this?