```
public int findMaxConsecutiveOnes(int[] nums) {
int precount = -1;
int count = 0;
int max = 0;
for(int i = 0; i < nums.length; i++) {
if(nums[i] == 1) {
count++;
} else {
max = Math.max(max, precount + count + 1);
precount = count;
count = 0;
}
}
max = Math.max(max, precount + count + 1);
return max;
}
```

Compute every consecutive 1s.