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 Step II?

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

Step-by-Step Solution

Words in alphabetical order are moon, star, sun. Step I moves moon to the front: moon sun 24 51 star 18. Step II moves star to the second position: moon star sun 24 51 18. Numbers are untouched until words are done.
Answer: D) moon star sun 24 51 18

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 an input line one step at a time.…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…