Question: please rewrite the following c++ program in python. please use 3 for loops as used in c++ program given ( important). indent it properly. And



please rewrite the following c++ program in python. please use 3 for loops as used in c++ program given ( important). indent it properly. And screenshot the python program and output. there is two test case given. Make sure the input and output is same as given in test case.
Problem 2 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
