Practice30Create account

A machine moves the shortest remaining word (fewest letters) to the left end in each step. Example — Input: elephant cat donkey ox; Step 1: ox elephant cat donkey; Step 2: ox cat elephant donkey. For the input 'planet sun star moon', what is Step 1?

Competition practiceInput-Output
  • Aplanet sun star moon
  • Bsun star moon planet
  • Csun planet star moon
  • Dsun moon star planet

Step-by-Step Solution

Word lengths are planet(6), sun(3), star(4), moon(4). The shortest is 'sun'; moving it to the front with others in order gives 'sun planet star moon'.
Answer: C) sun planet star moon

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 moves the smallest remaining number to the left end in each step. Example —…A machine moves the reverse-alphabetically first remaining word (nearest to Z) to the…A number-arrangement machine rearranges an input in steps by moving the largest…A number-arrangement machine rearranges an input in steps by moving the smallest…A word-arrangement machine rearranges an input in steps by moving the alphabetically…