Practice30Create account

A word-and-number arrangement machine, when given an input line of words and numbers, rearranges it in steps, and this machine makes the line shorter as it works. In each step the smallest number still in the line is struck out altogether, and the elements on either side of it close up. Words are never struck out, and the machine stops when only words are left in the line.
Input: 74 noodles 39 rice 52 pancake.
How many steps are needed to complete the rearrangement of the above input?

Competition practiceInput-Output
  • A4
  • B2
  • C6
  • D3

Step-by-Step Solution

Step 1 strikes out 39: 74 noodles rice 52 pancake. Step 2 strikes out 52: 74 noodles rice pancake. Step 3 strikes out 74: noodles rice pancake. Only words are left, so the machine stops after 3 steps. "4" adds a step for striking out a word, which this machine never does. "2" stops while 74 is still in the line. "6" counts one step per element of the input line.
Answer: D) 3

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