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 smallest perfect square among the numbers not already shifted is taken out and placed at the extreme left end of the line. Every other element keeps its relative position. Numbers that are not perfect squares are never shifted, and the machine stops as soon as no perfect square is left to shift.
Input: mango 32 nutmeg 16 olive 90 poplar 64 quince 25.
In Step 2 of the above arrangement, which element stands immediately to the right of "nutmeg"?

Competition practiceInput-Output
  • A32
  • B90
  • Cmango
  • Dolive

Step-by-Step Solution

The perfect squares are 16, 64 and 25; 32 and 90 are not squares. They are shifted smallest first, so 16 goes, then 25, then 64. Step 1: 16 mango 32 nutmeg olive 90 poplar 64 quince 25. Step 2: 25 16 mango 32 nutmeg olive 90 poplar 64 quince. Nutmeg is followed immediately by olive. The number 32 lies immediately to its left, not its right, and 90 comes one place further on. It is worth noticing that 16 was taken out from between nutmeg and olive in Step 1, which is what brings them together.
Answer: D) olive

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,…