0100101010에서 겹치는 경우 제외한 010갯수 세는 방법(find 여러번 사용방법)
int beautifulBinaryString(string b) {
string pattern = "010";
int answer=0;
size_t pos = b.find(pattern);
if(pos!=string::npos) answer++;
while(1)
{
pos = b.find(pattern, pos+ 3);
if(pos == string::npos) break;
else {cout<<pos<<' ';answer++;}
}
return answer;
}