Question: please write down comments for each step. Given two strings A and B, the task is to convert A to B if possible. The only

 please write down comments for each step. Given two strings A

and B, the task is to convert A to B if possible.

The only operation allowed is to put any character from A and

please write down comments for each step.

Given two strings A and B, the task is to convert A to B if possible. The only operation allowed is to put any character from A and insert it at front. Find if it's possible to convert the string. If yes then output minimum no. of operations required for transformation. Input: A- "ABD, B-"BAD Output: 1 Explanation: Pick B and insert it at front Input: A-EAC8D, B "EABCD" Output: 3 Explanation: Pick B and insert at front, EACBD -> BEACD Pick A and insert at front, BEACDABECD Pick E and insert at front, ABECD >EABCD

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!