35. 搜索插入位置-CSDN博客
744. 寻找比目标字母大的最小字母
class Solution {
public:char nextGreatestLetter(vector<char>& letters, char target) {if(target >= letters[letters.size() - 1])return letters[0];int low = 0;int mid;int high = letters.size()-1;while(low <= high){mid = (low+high)/2;if(target > letters[mid]){low = mid + 1;}else if(target < letters[mid]){high = mid -1;}else{std::cout<< mid;while(letters[mid] == letters[mid + 1]) mid++;//多个相同时可能会定位在中间return letters[mid + 1];}}return letters[high + 1];}
};