Yes, strictly speaking you are right; That's why it's called fool myself : )

"string::find"'s time complexity was unspecified (depends on your running lib's implementation) in the standard yet (probably for the space, average performance, and implementation etc. consideration I guess); but generally up to linear in size()-pos times the size of the sequence to match in "worst case"; Typically, average performance is better than that in real life.

Meanwhile, you can implement your own "find" lib by KMP (around using full DFA <=2N, but 1.1N typically), Boyer-Moore (full algorithm <=3N, N/M typically), Rabin-Karp (Monte Carlo <=7N) etc. that would be generalized to O(N). Or just a "prefix-suffix table" would be enough for the solution.

bool repeatedSubstringPattern(string& s) {
vector<int> T(s.size());
for(int i=1, j=0; i<s.size(); T[i] = j += (s[j]==s[i++])) while(j>0 && s[i]!=s[j]) j = T[j-1];
return T.back() && !(T.back()%(s.size()-T.back()));
}

Happy holiday season : )