459. Repeated Substring Pattern
202410252359
tags: #string
var repeatedSubstringPattern = function(s) {
const doubled = s + s;
const sub = doubled.slice(1, -1);
return sub.includes(s);
};
202410252359
tags: #string
var repeatedSubstringPattern = function(s) {
const doubled = s + s;
const sub = doubled.slice(1, -1);
return sub.includes(s);
};