3 arrays/max consecutive 1's/main.cpp
//NAIVE worst case when all elements are 1 O(n*n)
NAIVE worst case when all elements are 1 O(n*n)
NAIVE worst case when all elements are 1 O ( n * n )
int max1(int arr[], int n){
    int res=0;
    for(int i=0; i<n; i++){
        int curr=0;
        for(int j=i; j<n; j++){
            if(arr[j] == 1)
                curr++;
            else
                break;
        }
        res = max(res,curr);
    }
    return res;
}
int max1 ( int arr [ ] , int n ) { int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int curr = 0 ; for ( int j = i ; j < n ; j ++ ) { if ( arr [ j ] == 1 ) curr ++ ; else break ; } res = max ( res , curr ) ; } return res ; }
NAIVE worst case when all elements are 1 O(n*n)
NAIVE worst case when all elements are 1 O ( n * n )