Practice30Create account

A word-arranging machine rearranges an input line of words in steps. In each step it moves the alphabetically earliest of the not-yet-arranged words to the front, keeping the arranged words at the left in alphabetical order while the remaining words stay in their original order. Input: cat apple dog bear egg. What is Step 2 of the output?

Competition practiceInput-Output
  • Aapple cat dog bear egg
  • Bbear apple cat dog egg
  • Capple bear cat egg dog
  • Dapple bear cat dog egg

Step-by-Step Solution

After Step 1 (apple cat dog bear egg), the next earliest word 'bear' moves in behind 'apple', giving apple bear cat dog egg.
Answer: D) apple bear cat dog egg

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-arrangement machine, in each step, shifts the alphabetically-earliest…A number-arrangement machine, in each step, shifts the smallest not-yet-placed number to…A word-arrangement machine, in each step, shifts the alphabetically-earliest…A number-arrangement machine, in each step, shifts the largest not-yet-placed number to…A number-arrangement machine, given an input line, rearranges it step by step: in each…