滑动窗口的一种船新题型;
逐个元素遍历,确定满足要求的左右子区间;
自己还是头一次见这种思路;
具体代码:class Solution {
public:
int numFriendRequests(vector& ages) {
int cnt=0;
sort(ages.begin(),ages.end());
int l=0,r=0;
for(auto ele:ages){
if(ele<15){
r++;
continue;
}
while(ages[l] <= 0.5 * ele + 7)
l++;
while(r+1 


