Why it is partially correct can anybody explain


#1

int Solution::perfectPeak(vector &A) {
int n=A.size();
int i,j,f,fl;

for(i=1;i<n-1;i++){
    f=1,fl=1;
    for(j=i+1;j<n;j++){
        if(A[i]>=A[j]){
            f=0;
        }
    }
    for(j=0;j<i;j++){
        if(A[i]<=A[j]){
            fl=0;
        }
    }
    if(f==1 && fl==1){
        return 1;
    }
}
return 0;

}


#2

it says strictly greater than elements on left and strictly lesser than elements on right, so ditch the equality sign.
Also try optimising the solution cuz this approach will probably exceed time limit