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