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 word having the most letters, among the words not already shifted in an earlier step, is taken out and placed at the extreme right end of the line; if two words are equally long, the one that comes earlier in alphabetical order is taken first. Every other element keeps its relative position, and the machine stops once every word has been shifted.
Input: 26 mountain 73 elm 41 saffron 58 kite.
In the last step of the above arrangement, which element is second from the left end?

Competition practiceInput-Output
  • A26
  • B41
  • C73
  • Dkite

Step-by-Step Solution

Letter counts: mountain 8, saffron 7, kite 4, elm 3. Step 1: 26 73 elm 41 saffron 58 kite mountain. Step 2: 26 73 elm 41 58 kite mountain saffron. Step 3: 26 73 elm 41 58 mountain saffron kite. Step 4 (last): 26 73 41 58 mountain saffron kite elm. Second from the left is 73. Note that the numbers never move on their own, so they keep the order 26, 73, 41, 58 throughout — a solver who expects them to close up in a different way picks 41. Counting from the right end instead gives kite.
Answer: C) 73

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