Practice30Create account

A word-and-number arrangement machine, when given an input line of words and numbers, rearranges it in steps. In each step the machine compares the last letters of the words that have not already been shifted, takes the word whose last letter comes earliest in the alphabet, and places it at the extreme left end of the line; if two words end in the same letter, the shorter one is taken first. Every other element keeps its relative position, and the machine stops once every word has been shifted.
Input: 36 lantern 58 stucco 71 hazard 24 mimic.
In Step 3 of the above arrangement, which element is fifth from the left end?

Competition practiceInput-Output
  • A36
  • B58
  • Cstucco
  • D71

Step-by-Step Solution

Last letters: mimic ends in c, hazard in d, lantern in n, stucco in o. The order of shifting is therefore mimic, hazard, lantern, stucco. Step 1: mimic 36 lantern 58 stucco 71 hazard 24. Step 2: hazard mimic 36 lantern 58 stucco 71 24. Step 3: lantern hazard mimic 36 58 stucco 71 24. Counting from the left: lantern, hazard, mimic, 36, 58 — so 58 is fifth. Stopping a place short gives 36 and going a place past gives stucco. Note that hazard is taken before lantern even though l comes before h among first letters; only the final letters matter.
Answer: B) 58

Master this topic in 30 minutes a day.

Don't just memorise the answer — build a daily practice habit.

Practice 5 Similar Questions Free →

All Input-Output practice questions

More Input-Output practice

A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…