Practice30Create account

A word machine works so that in each step the word coming last in alphabetical order among the unarranged words moves to the right end (others keep order). Example — Input: cat apple dog bat → Step I: cat apple bat dog → Step II: apple bat cat dog. For the input 'sun rain moon cloud', what is Step I?

Competition practiceInput-Output
  • Arain moon cloud sun
  • Brain moon sun cloud
  • Cmoon rain cloud sun
  • Dcloud moon rain sun

Step-by-Step Solution

Alphabetically the last word is 'sun', which moves to the right end while the others keep order, giving 'rain moon cloud sun'.
Answer: A) rain moon cloud sun

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 machine brings, in each step, the smallest not-yet-placed number to the leftmost…A machine brings, in each step, the largest not-yet-placed number to the leftmost…A word machine brings, in each step, the word earliest in alphabetical order among the…A machine brings, in each step, the smallest not-yet-placed number to the leftmost…An arrangement machine rearranges an input line of numbers step by step by one fixed…