It works for O(n) solution also


#1

int Solution::search(const vector &A, int B) {
int n= A.size();
for(int i=0;i<n;i++){
if(A[i]==B)
return i;
}
return -1;
}


#2

Yes man , they should change there constrains
P.S. I solved in O(n) to get points :joy:


#3

Thats not fair buddy:joy: