题解 | #翻转子串#

翻转子串

https://www.nowcoder.com/practice/bc12808a2b0f445c96a64406d5513e96

import java.util.*;

public class ReverseEqual {
    public boolean checkReverseEqual(String s1, String s2) {
        // write code here

        if (s1.length() != s2.length()) {
            return false;
        }

        String str = s1+s1;
        return str.contains(s2);
    }
}

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务