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 number whose digits add up to the greatest total, among the numbers not already shifted in an earlier step, is taken out and placed at the extreme left end of the line; if two numbers give the same total, the larger of them is taken first. Every other element keeps its relative position, and the machine stops once every number has been shifted.
Input: anchor 76 puzzle 43 candle 19 ribbon 52.
At which step of the above arrangement does the line "52 19 76 anchor puzzle 43 candle ribbon" appear?

Competition practiceInput-Output
  • AStep 1
  • BStep 2
  • CStep 4
  • DStep 3

Step-by-Step Solution

Digit totals: 76 gives 13, 19 gives 10, 52 gives 7, 43 gives 7. The tie between 52 and 43 goes to the larger, so the order is 76, 19, 52, 43. Step 1: 76 anchor puzzle 43 candle 19 ribbon 52. Step 2: 19 76 anchor puzzle 43 candle ribbon 52. Step 3: 52 19 76 anchor puzzle 43 candle ribbon — the line asked about. Step 4 would be 43 52 19 76 anchor puzzle candle ribbon. Note that 43 still sits in mid-line at Step 3; a solver who lets the smaller of the tied pair go first arrives at the same line one step early and answers Step 2.
Answer: D) Step 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,…