I have a list with zeros separated by ones and I want to count the zeros between the ones. I tried pure functions but in the wrong way. Can anybody give me a solution? (Needless to say that I am not very experience in Mathematica.)
In[23]:= Test = {1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0};
In[24]:= Test = Flatten[Position[Test, 1]]
Out[24]= {1, 6, 9}
{* The output should be {4, 2}
I tried Map[#2 - #1 - 1 &, Test]
but it dosn’ t.