Question: I need to write a program in python using only recursion : to check if s3 is in a complete compinantion (interleaved) of s1 and

I need to write a program in python using only recursion :

to check if s3 is in a complete compinantion (interleaved) of s1 and s2. for example : s1 = "abc" , s2 = "def" . s3 can be "abcdef" , "adbecf" the order of the characters in s1 and s2 must be the same in s3 (but not just one after another) (we can use : index , find , split , [ : ], s1

#

S1

S2

S3

output

1

""

""

""

True

2

"abc"

""

"abc"

True

3

"abc"

"def"

"abcdef"

True

4

"abc"

"def"

"daebcf"

True

5

"abc"

"def"

"adfbce"

False

6

"ab c"

"def"

"deab cf"

True

7

"morning Venm"

"Good ita!"

"Good morning Vietnam!"

True

8

"ABZ"

"ABAXZ"

"ABAXABZZ"

True

9

"ABAXZ"

"ABZ"

"ABAXABZZ"

True

10

"12189"

"129"

"12181299"

True

11

"12189"

"129"

"12112998"

False

12

"TTTT"

"X"

"XXXXX"

False

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!