The problem is this: There is an array of M binary numbers and each of them is in state '0' or '1'. You can perform several steps in changing the state of the numbers and in each step you are allowed to change the state of exactly N sequential numbers. Given the numbers M, N and the array with the members of course, you are about to calculate the minimal number of steps needed to turn all the binary numbers into one state - 1 or 0.
EDIT: Ex:
If M = 6 and N = 3 and the array is 1 0 0 1 0 0, then the solution will be 2. Explanation: We can flip them so they all be 1 in two steps: we flipt from index 2 to 4 and we transform the array to 111000, and then flip the last three (N) 0s to 1.
I would like to know if someone here could help me with this. Also i am not from english speaking community so i would like to help me find the correct title of the problem (if there's one). Also i've heard this problem (or some similar one) is on TopCoder, solved. I would like if i could get the link if any of you knows it.
Thank you.