```
public class Solution {
public int findMaxConsecutiveOnes(int[] nums) {
int maxSum = 0, sum = 0;
for (int n : nums) {
sum *= n;
sum += n;
maxSum = Math.max(maxSum, sum);
}
return maxSum;
}
}
```