1 line c++ O(logn) sol


#1

int Solution::solve(vector &A, int B) {
return upper_bound(A.begin(),A.end(),B)-A.begin();
}