Question 12

A string s3 consists of multiple repetitions of s1.

Given s1 and another string s2, find if s2 is a substring of s3.

s3 = s1 + s1 + … + s1 = n * s1, where n is a positive integer 0.

For example

s1 = “aabc”, s2 = “caa” => true

s1 = “aabc”, s2 = “cab” => false

s1 = “aabc”, s2 = “caabcaa” =? true

[advanced_iframe securitykey=”undefined” src=”https://code.kodnest.com/” width=”100%” height=”600″]

KodNest Training New Batch is starting on 02nd November 2020. Attend one week free demo classes.Register Now

New Report

Close