Practice30Create account

A word-and-number arrangement machine rearranges an input line one step at a time. Illustration — Input: cat 45 dog 12 ant 30; Step I: ant cat 45 dog 12 30; Step II: ant cat dog 45 12 30; Step III: ant cat dog 12 45 30; Step IV: ant cat dog 12 30 45 (last step). The rule: words are arranged in alphabetical order from the left (one per step), and once all words are done, numbers are arranged in ascending order from the left (one per step). For the Input: sun 24 moon 51 star 18, what is the arrangement in the last step?

Competition practiceInput-Output
  • Amoon star sun 18 51 24
  • Bmoon star sun 51 24 18
  • Cmoon star sun 18 24 51
  • Dsun star moon 18 24 51

Step-by-Step Solution

The final arrangement has all words in alphabetical order (moon, star, sun) followed by all numbers in ascending order (18, 24, 51): moon star sun 18 24 51.
Answer: C) moon star sun 18 24 51

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 arranging machine, when given an input line, rearranges it step by…A word-and-number arranging machine, in each step, moves the largest of the…A word-and-number arranging machine, in each step, moves the largest of the…A number-arranging machine rearranges a line of numbers step by step. In each step it…A number-arranging machine rearranges a line of numbers step by step. In each step it…