Function that returns true if str1 can be made equal to str2 by rotating either d places to the left or to the right
bool RotateAndCheck ( string & str1 , string & str2 , int d ) { if ( str1 . length ( ) != str2 . length ( ) ) return false ;