Question: Please ASAP in java ing Boot F Learn to speak a la... Full Stack Java Soft... (5) New Tab 4. Learn about how to... Given

Please ASAP in java

Please ASAP in java ing Boot F Learn to speak a la...

ing Boot F Learn to speak a la... Full Stack Java Soft... (5) New Tab 4. Learn about how to... Given a source string S containing all the decimal digits exactly once in any order and a destination string D containing all the decimal digits exactly once in any other order, write a program to find the minimal number of moves required to transform string S to string D. A move consist of swapping any two "adjacent" digits. Ex: 124567 becomes 142567 on a single move which swaps the adjacent digits 2 and 4. Input format The input consists of 2 lines, each line containing a string of all decimal digits exactly once in some order, including 0 Constraints Length of the input strings is exactly ten corresponding to the decimal digits 09 Output format The program or function must print out a single integer representing the number of minimal "swaps" required to generate the string in input line 2 from the string in input line 1

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!