《CTCI》1.8 调用一次isSubstring判断旋转字符串

来源:互联网 发布:可可英语软件下载 编辑:程序博客网 时间:2024/05/14 01:49

《CITI》P116

1 数组与字符串

题目:

1.8 Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, si and s2, write code to check Ifs2 is a rotation of si using only onecalltoisSubstring (e.g., “waterbottLe” is a rotation of “erbottLewat”).

0 0
原创粉丝点击