```
def findMaxConsecutiveOnes(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
lenNums = len(nums)
if lenNums == 0:
return 0
#print "nums = ",nums
#print "lenNums = ", lenNums
res, zero, left, k = 0,0,0,1
for right in range(lenNums):
#print "right = ", right
if nums[right] == 0:
zero += 1
while (zero > k):
if (nums[left] == 0):
zero -= 1
left+= 1
res = max(res, right-left+1)
#print "res = ", res
return res
```