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: granite 58 pebble 94 marsh 27 dune 63.
In Step 2 of the above arrangement, which element is third from the right end?

Competition practiceInput-Output
  • Adune
  • B27
  • Cmarsh
  • Dgranite

Step-by-Step Solution

Digit totals: 58 and 94 both give 13, and 27 and 63 both give 9. The larger of each tied pair goes first, so the order is 94, 58, 63, 27. Step 1: 94 granite 58 pebble marsh 27 dune 63. Step 2: 58 94 granite pebble marsh 27 dune 63. Counting from the right end of Step 2: 63, dune, 27 — so 27 is third. Stopping one short gives dune, going one too far gives marsh, and counting from the left end instead lands on granite.
Answer: B) 27

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