For example, I have 4 in a row like so:
xxxx
I can see that it has 2 xxx in it and 3 xx. Is there a way to quickly get how much of each 'x' in a row there are for any length of x's?
So for $N$ x in a row, how many 'x' in a row of each length are there from $N-1$ to $2$.
For $N$ x in a row, we have $N$ x, we have $N-1$ of 2 x's in a row, N-2 of 3 x's in a row.
In general we have $N-k+1$ of $k$ x's in a row.
To see why is that so, construct a window of length $k$ and move it.