/**
 *Given a binary array, find the maximum number of consecutive 1s in this array.
 *Input: [1,1,0,1,1,1]
 *Output: 3
 *Complexity O(n) time , and O(1) space.
 *trick count the number of ones until you see a different number and record the Max value as you go along.
 *When you see if reset the count.
 */
public class Solution {
    public int findMaxConsecutiveOnes(int[] nums) {
        int numOfOnes = 0;
        int numOfConsecutiveOnes = Integer.MIN_VALUE;
        for (int i = 0; i < nums.length; i++) {
            if ( nums[i] != 1 ) {
                numOfOnes = 0;
            } else {
                 numOfOnes++;
            }
          numOfConsecutiveOnes = Math.max(numOfOnes, numOfConsecutiveOnes);
        }
        return numOfConsecutiveOnes;
    }
}

@@ -325,18 +325,16 @@
 ution %7B%0A
-  
   public
@@ -371,28 +371,24 @@
 t%5B%5D nums) %7B%0A
-    
     int numO
@@ -402,20 +402,16 @@
  0;%0A    
-   
- 
 int numO
@@ -448,20 +448,16 @@
 _VALUE;%0A
-    
     for 
@@ -502,19 +502,12 @@
     
-   
-   
 if (
- 
 nums
@@ -514,17 +514,16 @@
 %5Bi%5D != 1
- 
 ) %7B%0A    
@@ -522,32 +522,24 @@
 ) %7B%0A        
-   
-     
 numOfOnes = 
@@ -547,22 +547,16 @@
 ;%0A      
-   
-   
 %7D else %7B
@@ -564,25 +564,16 @@
         
-     
-    
 numOfOne
@@ -583,28 +583,18 @@
 ;%0A      
-    
-  %7D%0A    
+%7D%0A
       nu
@@ -661,26 +661,18 @@
 s);%0A    
-    %7D%0A    
+%7D%0A
     retu
@@ -696,16 +696,14 @@
 veOnes;%0A
-  
   %7D%0A%7D%0A

Fix styling