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);
};

Reference

https://leetcode.com/problems/repeated-substring-pattern/