力扣常用c++操作
数字转字符串 to_string()
自定义sort函数
sort(intervals.begin(),intervals.end(),[](vector<int> &v1, vector<int>& v2){
return v1[0]<v2[0];
});
自定义二分查找
auto insertit = lower_bound(intervals.begin(),intervals.end(),newInterval[0],[](vector<int> &v1,int val){
return v1[0]<val;
});
auto insertit = lower_bound(intervals.begin(),intervals.end(),newInterval[0],greater<int>());
unordered_set
unordered_set<char> windows;
windows.count(s[r-1])==0
windows.insert(s[r-1]);
windows.erase(s[l]);
priority_queue
struct cmp
{
bool operator()(ListNode* n1,ListNode* n2){
return n1->val>n2->val;
}
};
priority_queue<ListNode*,deque<ListNode*>,cmp> q;