标签:bsp arc amp range pre 数组 == lower search
1 class Solution 2 { 3 public: 4 vector<int> searchRange(vector<int>& nums, int target) 5 { 6 auto it = find(nums.begin(),nums.end(),target); 7 if(it == nums.end()) return {-1,-1}; 8 auto b = lower_bound(nums.begin(),nums.end(),target) - nums.begin(); 9 auto e = upper_bound(nums.begin(),nums.end(),target) - nums.begin(); 10 return {b,e - 1}; 11 } 12 };
标签:bsp arc amp range pre 数组 == lower search
原文地址:https://www.cnblogs.com/yuhong1103/p/12512500.html