LeetCode: Repeated Substring Pattern
Problem:
https://leetcode.com/problems/repeated-substring-pattern/
Code:
class Solution:
def repeatedSubstringPattern(self, s: str) -> bool:
return s in (s + s)[1:-1]
# Points to note:
# - A repeated string will reappear ...
is-power-of-two.hashnode.dev4 min read