A word arrangement machine, when given an input line of words, rearranges them step by step following a particular rule. An illustration of an input and its rearrangement is given below.
Input: guitar silk timber cricket goat tabla compass mirror
Step I: compass guitar silk cricket goat tabla mirror timber
Step II: compass cricket guitar silk goat mirror tabla timber
Step III: compass cricket goat guitar mirror silk tabla timber
Step III is the last step of this input.
Input: mushroom butterfly button horse kitten wire bottle bee
Following the same rule, which word will be third from the left end in Step II for this input?
Answer & explanation
Correct answer: option 3
The correct answer is Option (3) → butterfly
Compare each step of the illustration with the one before it. In each step, the word that comes first in dictionary order among the words not yet arranged moves to the next place from the left end and the word that comes last in dictionary order among them moves to the next place from the right end, both in the same step; the other words keep their order.
Step I: ‘compass’ (first in dictionary order among the words left) moves to the first place from the left, and ‘timber’ (last in dictionary order) moves to the first place from the right
Step II: ‘cricket’ (first in dictionary order among the words left) moves to the second place from the left, and ‘tabla’ (last in dictionary order) moves to the second place from the right
Step III: ‘goat’ (first in dictionary order among the words left) moves to the third place from the left, and ‘silk’ (last in dictionary order) moves to the third place from the right
After Step III the words stand in dictionary order, so the arrangement is complete.
Apply the same rule to the input mushroom butterfly button horse kitten wire bottle bee.
Step I: ‘bee’ (first in dictionary order among the words left) moves to the first place from the left, and ‘wire’ (last in dictionary order) moves to the first place from the right, giving bee mushroom butterfly button horse kitten bottle wire
Step II: ‘bottle’ (first in dictionary order among the words left) moves to the second place from the left, and ‘mushroom’ (last in dictionary order) moves to the second place from the right, giving bee bottle butterfly button horse kitten mushroom wire
Counting from the left end of bee bottle butterfly button horse kitten mushroom wire: bee (first), bottle (second), butterfly (third).
So the word third from the left end is butterfly.