Minimum times A has to be repeated such that B is a substring of it
Given two strings A and B. Find minimum number of times A has to be repeated such that B is a Substring of it. If B can never be a substring then return -1.
- Time : O(m)
- Space : O(m)
c++
1 | class Solution { |