Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Administration The Essential Reference

Authors: Brian Laskey, David Kreines

1st Edition

1565925165, 978-1565925168

More Books

Students also viewed these Databases questions

Question

2. Define identity.

Answered: 1 week ago