题目描述:
class Solution { public int findMaxConsecutiveOnes(int[] nums) { int i ,count=0, ones=0; for (i=0;i<nums.length;i++){ if (nums[i]==1){ count++; } else count=0; if(count>ones) ones = count; } return ones; } }