Search for a Range Time : Space : 1234567vector<int> Solution::searchRange(const vector<int> &A, int B) { auto l = lower_bound(begin(A), end(A), B) - begin(A); auto r = upper_bound(begin(A), end(A), B) - begin(A) - 1; if(0 <= l and l < A.size() and A[l] == B) return {l,r}; return {-1,-1};}