leetcode459 C++ 32ms 重复子串构成的字符串

class Solution {
public:
    bool repeatedSubstringPattern(string s) {
        string ss = s + s;
        string ss_(ss.begin() + 1, ss.end() - 1);
        return (ss_.find(s)<=ss.size());
    }
};

posted @ 2018-07-26 18:25  一条图图犬  阅读(383)  评论(0编辑  收藏  举报