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 left 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 right end of the line. All the remaining elements keep their relative order, and the machine stops when no further shift is possible.
Input: 73 tree apple 29 56 sun nest 84.
Which of the following is Step 3 of the above arrangement?

Competition practiceInput-Output
  • A29 56 73 84 tree sun nest apple
  • B73 84 apple 29 56 nest tree sun
  • C73 56 29 tree 84 apple nest sun
  • D56 73 84 apple 29 tree sun nest

Step-by-Step Solution

Work the machine forward from the input. Step 1: 84 73 apple 29 56 sun nest tree. Step 2: 73 84 apple 29 56 nest tree sun. Step 3: 56 73 84 apple 29 tree sun nest. Hence the line shown is Step 3.
Answer: D) 56 73 84 apple 29 tree sun nest

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