static boolean areRotations(String str1, String str2)
{
// There lengths must be same and str2 must be
// a substring of str1 concatenated with str1.
return (str1.length() == str2.length()) &&
((str1 + str1).indexOf(str2) != -1);
}
https://www.techgig.com/geekgoddess/participationconfirmation?auto_login=hqiClZqOUo61kdCKjqFhmYuXjZ2vlIyIk61hRkplR0dyVpBZXHhWY0lJZEZkV5JdXHRTXF5XVA==&utm_source=Mailer&utm_medium=TG_batch&utm_campaign=tg32016_final_round_confirm_alert_mailer_2017-03-02&email=bharti.kukreja@verizon.com&activity_name=tg32016_final_round_confirm_alert_mailer_2017-03-02&src_type=autoLogin