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 takes the smallest of the numbers that are divisible by 3 and have not already been shifted, and places it at the extreme left end of the line. Numbers not divisible by 3, and all the words, are never shifted; every other element keeps its relative position, and the machine stops once every number divisible by 3 has been shifted.
Input: 46 tabla 27 nashik 51 jacket 33 veena.
Which of the following is Step 2 of the above arrangement?

Competition practiceInput-Output
  • A33 27 46 tabla nashik 51 jacket veena
  • B27 46 tabla nashik 51 jacket 33 veena
  • C27 33 46 tabla nashik 51 jacket veena
  • D51 27 46 tabla nashik jacket 33 veena

Step-by-Step Solution

The multiples of 3 in the line are 27, 33 and 51, and they are shifted smallest first. Step 1 moves 27 to the extreme left: 27 46 tabla nashik 51 jacket 33 veena. Step 2 moves 33 (the next smallest) to the extreme left: 33 27 46 tabla nashik 51 jacket veena, which is the answer. "27 46 tabla nashik 51 jacket 33 veena" is Step 1, an off-by-one step. "27 33 46 tabla nashik 51 jacket veena" keeps the two shifted numbers in ascending order at the left, forgetting that each new number is pushed in front of the earlier one. "51 27 46 tabla nashik jacket 33 veena" takes the multiples of 3 largest first instead of smallest first.
Answer: A) 33 27 46 tabla nashik 51 jacket veena

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,…An arrangement machine works on an input line of words and numbers in steps, using only…An arrangement machine works on an input line of words and numbers in steps, using only…