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


please write down comment for each steps.
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# "EACBD", B-"EABCD Output: 3 Explanation: Pick B and insert at front, EACBD->BEACD Pick A and insert at front, BEACD >ABECD Pick E and insert at front, ABECD > EABCD
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
