how to find that two strings are cyclic or not, in less than O(n^2) and without using a third array.
Input
str1 = "abcde" str="eabcd"
output
cyclic
Input
str1 = "cabdc" str="ccabd"
output
cyclic
Input
str1 = "ddabnhdd" str="dddabnhd"
output
cyclic
Please suggest me the best possible solution of it ???