-
Binary iteration question
Hi All,
Given a binary list of any length e.g:
test:00001111000111001101000bIs there some way to iterate through this with 2 values – e.g input:3 , output:2
So that every time the input is 1 at least 3 times in a row (input param) , we let the result equal 1 and only when there are more consecutive 0’s than the output param, do we reset.
Example output for test above:
00000011110001111111110b
Another sample:
Input: 110010111001111bOutput: 000000001111111b
I tried to use msum so if input is 3:
3 msum testGives the points where 3 consecutive 1’s have been detected however can’t seem to carry this value for the next two iterations.
Any help appreciated!
Log in to reply.