Hi there, I’m trying to run a counting operation on a true/false boolean list. Within a list of values, I want to count any continuous sequential occurrences of “false” BEFORE the 1st true, then also count any continuous sequential occurrences of “false” AFTER the last true. Is there a data structure that will do this? I tried starting with getting the index of the occurrences but I got stuck because it only lists the index of the first occurrence. So in this example I would get (1,0),(1,1),(1,1)… and so on
for something like this:
false
false
true
false
true
false
false
I should get: (2,2)
Thanks!