题解 | #翻转单词序列#
翻转子串
http://www.nowcoder.com/practice/bc12808a2b0f445c96a64406d5513e96
public boolean checkReverseEqual(String s1, String s2) {
if (s1.length() != s2.length()) {
return false;
}
String str = s1 + s1;
return str.contains(s2);
}
public static void main(String[] args) {
Solution solution = new Solution();
System.out.println(solution.checkReverseEqual("waterbottle", "erbottlewat"));
}
}