https://school.programmers.co.kr/learn/courses/30/lessons/131127?language=cpp#
#include <string>
#include <vector>
#include<algorithm>
#include<iostream>
/*
슬라이딩윈도우
*/
using namespace std;
int solution(vector<string> want, vector<int> number, vector<string> discount) {
int answer = 0;
bool isOk = true;
for(int y= 0; y <= discount.size() - 10; ++y){
for(int x = 0; x < want.size() ; ++x){
//cout<<"discount[y]: "<<y<<endl;
//cout<<"want[x]: "<<x<<endl;
int num = count(discount.begin() + y, discount.begin()+y+10,want[x]);
//std::cout<<"num: "<< num<<endl;
if(num < number[x])
{
isOk =false;
break;
}
}
if(isOk)answer++;
isOk = true;
}
return answer;
}