```
public class Solution {
public int findMaxConsecutiveOnes(int[] nums) {
int start = 0, max = 0, count = 0;
for(int i=0;i<nums.length;i++) {
if(nums[i] == 0) {
count++;
}
while(count >= 2) {
if(nums[start] == 0) {
count--;
}
start++;
}
max = Math.max(max, i - start +1);
}
return max;
}
```

}