Question LR-IO-0011
MediumA machine rearranges a line of words and numbers. In odd-numbered steps it moves the word that comes first in dictionary order (among those not yet arranged) to the left end of the unarranged part; in even-numbered steps it does the same with the smallest number not yet arranged.
Input: tulip 21 44 rose 12 lily 36 iris
How many steps are needed to complete the arrangement?
- A.
5
- B.
6
- C.
Sign up free to see the answer and a step-by-step explanation.