给定2个字符串s1和s2,请判断s2是否为s1旋转而成,返回bool值。字符串中字符为英文字母和空格,区分大小写,字符串长度小于等于1000。 测试样例: "Hello world","worldhello " 返回:false "waterbottle","erbottlewat" 返回:true
加载中...
import java.util.*; public class ReverseEqual { public boolean checkReverseEqual(String s1, String s2) { // write code here } }
class ReverseEqual { public: bool checkReverseEqual(string s1, string s2) { // write code here } };
# -*- coding:utf-8 -*- class ReverseEqual: def checkReverseEqual(self, s1, s2): # write code here
class ReverseEqual { public bool checkReverseEqual(string s1, string s2) { // write code here } }