class Solution {
public:
int repeatedStringMatch(string A, string B) {
string mA;
int m=0;
while(mA.size() <= B.size()){
mA += A;
m++;
if(mA.find(B) < mA.size()){
return m;
}
}
mA += A;
m++;
if(mA.find(B) < mA.size()){
return m;
}
return -1;
}
};