Practice30Create account

A word-and-number arrangement machine rearranges an input line in steps. In each step one number and one word are placed alternately from the left: numbers in ascending order (smallest first) and words in alphabetical order, while the remaining items keep their relative order and shift right. For the input 'Input: 45 tree 12 sun 78 rain 33 hill', the successive steps are Step I: '12 45 tree sun 78 rain 33 hill', Step II: '12 hill 45 tree sun 78 rain 33', Step III: '12 hill 33 45 tree sun 78 rain', Step IV: '12 hill 33 rain 45 tree sun 78', Step V: '12 hill 33 rain 45 tree sun 78', Step VI: '12 hill 33 rain 45 sun tree 78'. In Step VI, which element is fourth from the right end?

Competition practiceInput-Output
  • A45
  • Bsun
  • Ctree
  • Drain

Step-by-Step Solution

Step VI is '12 hill 33 rain 45 sun tree 78'. Counting from the right: 78 (1st), tree (2nd), sun (3rd), 45 (4th).
Answer: A) 45

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 rearrangement machine works in steps. In each step it picks the word that comes…A word-and-number arrangement machine, given an input line, rearranges it by a fixed…A word-and-number arrangement machine, given an input line, rearranges it by a fixed…A number-arranging machine rearranges an input line of numbers step by step. Example —…A number-arranging machine rearranges an input line of numbers step by step. Example —…