1.str1="1234",str2="2341"
2.判断str2是否为str1的旋转字串:
1.str=str1+str1 ,即"12341234"
2.利用kmp算法(O(m+n))判断是否str包含str2
3.str中的任意长度为N的子串都是str1的旋转字串。
str1="god i like you." 变为str2="you like i god"
步骤:
1.反转字符串为".uoy ekil i dog"
2.逐词反转,"you. like i god"
3.反转方法:
按照字符串长度的奇偶性反转。
原文:https://www.cnblogs.com/lshao/p/8984891.html