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
Get step-by-step solutions from verified subject matter experts
