check two string is rotated of each other without extra space