Practice30Create account

A machine rearranges an input line of words and numbers using a fixed rule, one element per step. Example - Input: sun 52 rain 19 cloud 33; Step I: 19 sun 52 rain cloud 33; Step II: 19 33 sun 52 rain cloud; Step III: 19 33 52 sun rain cloud (last step). In each step the smallest not-yet-arranged number is moved to just after the already-arranged numbers at the left, keeping all other elements in their existing order. Using the same rule, for the input 'gold 74 lake 23 mist 56 61 pen', which line is Step II?

Competition practiceInput-Output
  • A23 56 gold 74 lake mist 61 pen
  • B23 56 61 gold 74 lake mist pen
  • C23 56 gold lake 74 mist 61 pen
  • D23 gold 56 74 lake mist 61 pen

Step-by-Step Solution

Numbers in ascending order are 23, 56, 61, 74. Step I moves 23 to the front: 23 gold 74 lake mist 56 61 pen. Step II moves the next smallest, 56, to just after 23, keeping the rest in order: 23 56 gold 74 lake mist 61 pen.
Answer: A) 23 56 gold 74 lake mist 61 pen

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 number-arranging machine rearranges an input line of numbers using one rule at each…A number-arranging machine rearranges an input line of numbers using one rule at each…A word-and-number arrangement machine, given an input line, rearranges it in steps. In…A word-and-number arrangement machine, given an input line, rearranges it in steps. In…A word-arrangement machine rearranges an input line of words in steps. Input: 'tree…