Question: I need help with this question: you are given a line with the letters L (large), M (medium) and S (small). You can only swap

I need help with this question: you are given a line with the letters L (large), M (medium) and S (small). You can only swap 2 of them at a time to arrange the letters from L to S. The program should give the smallest number of swaps to arrange the letters. For example, you are given LLSLM and the program should return 2.

The question needs to be done using python.

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!