This reminds me of maximum sum subvector problem I had to do. For this you can just do, if(A[i] == 1 && A[i -1] == 1), the count would go up. Then that count would be initialized to some variable, I...