Question LR-IO-0020
HardA word-arrangement machine rearranges a line of words step by step. In each step it moves the word that comes first in dictionary order, among those not yet arranged, to the left end of the unarranged part (just after the words already arranged).
Input: vine ugly tour sole rank
The input is reversed in order before it enters the machine. How many steps does the machine now need?
- A.
0
- B.
2
- C.
Sign up free to see the answer and a step-by-step explanation.