Given two strings a and b, return the minimum number of times a must be repeated so that b becomes a substring of the repeated string. If no number of repetitions of a can make b a substring, return -1.
Implement the method int repeatedStringMatch(str a, str b).
Constraints:
a.length, b.length
a and b consist of lowercase English letters.
Given two strings a and b, return the minimum number of times a must be repeated so that b becomes a substring of the repeated string. If no number of repetitions of a can make b a substring, return -1.
Implement the method int repeatedStringMatch(str a, str b).
Constraints:
a.length, b.length
a and b consist of lowercase English letters.