1.9 StringRotation:Assumeyouhaveamethodi5Sub5tringwhichchecksifonewordisasubstring of another. Given two strings, s1 and s2, write code to check if s2 is a rotation of s1 using only one call to i5Sub5tring (e.g., "waterbottle" is a rotation of" erbottlewat").
Highlight:
check rotation -> s2 is a subtring of s1s1
bool isRotation(string str1, string str2){
if(str1.size()!=str2.size()) return false;
string s1s1 = str1 + str1;
if(s1s1.find(str2)!=string::npos){
return true;
}
return false;
}