Practice30Create account

A word-and-number arrangement machine rearranges any input line in steps. In each step two shifts happen together: the largest number that has not already been shifted in an earlier step is taken out and placed at the extreme right end of the line, and at the same time the word that comes last in alphabetical order among the words not already shifted in an earlier step is taken out and placed at the extreme left end of the line. All the remaining elements keep their relative order, and the machine stops when no further shift is possible.
Input: 15 62 moon leaf 49 kiwi 87 harp 33 dove.
Which of the following is Step 3 of the above arrangement?

Competition practiceInput-Output
  • Aharp kiwi leaf moon 15 dove 87 62 49 33
  • Bleaf moon 15 49 kiwi harp 33 dove 87 62
  • Ckiwi leaf moon 15 harp 33 dove 87 62 49
  • Dkiwi harp dove 62 moon leaf 87 15 33 49

Step-by-Step Solution

Work the machine forward from the input. Step 1: moon 15 62 leaf 49 kiwi harp 33 dove 87. Step 2: leaf moon 15 49 kiwi harp 33 dove 87 62. Step 3: kiwi leaf moon 15 harp 33 dove 87 62 49. Hence the line shown is Step 3.
Answer: C) kiwi leaf moon 15 harp 33 dove 87 62 49

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, alternating…A word-and-number arrangement machine rearranges any input line in steps, alternating…A word-and-number arrangement machine rearranges any input line in steps. In each step…A word-and-number arrangement machine rearranges any input line in steps. In each step…A word-and-number arrangement machine rearranges any input line in steps. In each step…