Timme limit exceeded!


#1

int Solution::solve(vector &A) {
for(int i =0 ;i<A.size();i++){

    int current =A[i];
    int j;
    for(j=i+1; j<A.size();j++){
        if(A[j]>current)break;
    }
     for(int k=j+1; k<A.size();k++){
       if( A[k]<current)return 0;
    }
    
}
return 1;

}