Question: Please use python to solve it Write a function: 2 int solution(string &A, string &B); that, given a string A consisting of N characters and

Please use python to solve it
 Please use python to solve it Write a function: 2 int

Write a function: 2 int solution(string &A, string &B); that, given a string A consisting of N characters and a string B consisting of M characters, returns the number of times A must be stated such that B is a substring of the repeated string. If B can never be a substring of the repeated A, then your function should return-1. For example, given: A = "abcd" B = "cdabcdab. your function should return 3, because after stating string A three times we obtain the string abcdabcdabed String B is a substring of this string Assume that N is an integer within the range [1.1000 . M is an integer within the range [1.1000]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!