I have the following string:
"TTTHTHTTHTTTTHTTTHTTTTTTHTTTTTHTH"
I would like to be able to group by the T's into a list and then count the number of T's to the first H.
i.e. so like
[3, 1, 2, 4, 3, 6, 5, 1]
Whats the most efficient way to do this in python ?