Education + Jobs Hiring Website - 2025
0 like 0 dislike
2,057 views
in Interview-Experiences by Expert (32,020 points) | 2,057 views

1 Answer

0 like 0 dislike
Question : Given two strings S1 and S2, find the number of times S1 needs to append to itself such that S2 is subsequence of S1. S1 and S2 contain only lowercase english alphabets
Testcase :
I/p : S1 = time , S2 = meit
O/p : 2 i.e., meit is subsequence of timetimetime

 

Expected solution along with Hint : 2-D Dp solution with Time and Space is O(26*n)

 

Can someone help me with this question. Thanks in advance.
by Expert (32,020 points)