Method to check if string2 is obtained by string 1
function isRotated ( str1 , str2 ) { if ( str1 . length != str2 . length ) return false ; if ( str1 . length < 2 ) { return str1 . localeCompare ( str2 ) ; } let clock_rot = " " ; let anticlock_rot = " " ; let len = str2 . length ;