Question LR-IO-0003
EasyA 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: mint dove apex kite jolt
How many steps are needed to complete the arrangement?
- A.
4
- B.
3
- C.
Show answer and explanation
Answer: A
Steps:
Step 1: apex mint dove kite jolt
Step 2: apex dove mint kite jolt
Step 3: apex dove jolt mint kite
Step 4: apex dove jolt kite mint
The words are in order after Step 4.