Max Consecutive Ones

I do believe that the definition of 'consecutive' would mean at least 2 elements of the same immediately in sequence.

So the output '0' for the array [1] seems correct to me. There are no consecutive 1s in that array.

Comments (2)