Search
⌘K

Leetcode 686. Repeated String Match

Find the minimum number of times string a must be concatenated with itself so that b appears as a contiguous substring of the result, or return -1 if impossible. Because of overlaps, you only need to consider a bounded number of repeats (roughly ceil(len(b)/len(a)) + 1).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.