using System;
public class Program
{
public static void Main()
Console.WriteLine("Hello World");
//Find the maximum consecutive 1’s in an array of 0’s and 1’s.
//Input: 00110001001110 Output: 3 (max num of 1s together is 3)
//Input: 1000010001 Output: 1
var input = new int[0,0,1,1,0,0,0,1,0,0,1,1,1,0];
consecutiveNumber(input);
}
public int consecutiveNumber(int[] input)
int oneNumber=0;
for(int i=0; i<input.Length; i++)
if(input[i]==1 && oneNumber >= 0)
oneNumber +=1;
else
oneNumber = 0;
return oneNumber;