Be as lazy as you can


  • 0
    J
    vector<int> searchRange(vector<int>& nums, int target) {
            auto range = equal_range(nums.begin(), nums.end(), target);
            if(range.first == range.second) return {-1, -1};
            else return {range.first -  nums.begin(), range.second - nums.begin() - 1};
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.