public static void Main()
int[] x = new int []{0, 0, 0, 1, 1, 1};
int[] x1 = new int[]{1, 1, 1, 1, 1, 1};
int[] x2 = new int[]{0, 1, 1, 1, 1, 1};
int[][] nums = new int[][]
Console.WriteLine(countOnes(nums));
Console.WriteLine(getFirstOne(x));
public static int countOnes(int[][] nums)
for(int i = 0; i < nums.Length; i++)
int firstOccurence = getFirstOne(nums[i]);
int numOnesInRow = nums[0].Length - firstOccurence;
public static int getFirstOne(int[] nums)
int end = nums.Length - 1;
int mid = start + (end - start)/2;