Practice30Create account

A word-and-number arrangement machine rearranges any input line in steps, alternating between two shifts. In every odd-numbered step (Step 1, 3, 5, ...) the largest number that has not already been shifted in an earlier step is taken out and placed at the extreme left end of the line. In every even-numbered step (Step 2, 4, 6, ...) the word that comes first in alphabetical order among the words not already shifted in an earlier step is taken out and placed at the extreme right end of the line. All the remaining elements keep their relative order, and the machine stops when no further shift is possible.
Input: river 11 mango 47 kite 82 dawn 39.
At which step of the above arrangement does the line "47 82 river 11 mango 39 dawn kite" appear?

Competition practiceInput-Output
  • AStep 5
  • BStep 4
  • CStep 3
  • DStep 6

Step-by-Step Solution

Step 1: 82 river 11 mango 47 kite dawn 39. Step 2: 82 river 11 mango 47 kite 39 dawn. Step 3: 47 82 river 11 mango kite 39 dawn. Step 4: 47 82 river 11 mango 39 dawn kite. The line quoted matches Step 4.
Answer: B) Step 4

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 rearranges any input line in steps. In each step…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,…