Practice30Create account

A machine rearranges words by moving the word that comes last in alphabetical order (among those not yet placed) to the left at each step. Example - Input: 'apple mango cherry'; Step 1: 'mango apple cherry'; Step 2: 'mango cherry apple'. For the input 'lion zebra bear tiger', what is Step 2?

Competition practiceInput-Output
  • Atiger zebra lion bear
  • Bzebra lion bear tiger
  • Czebra tiger bear lion
  • Dzebra tiger lion bear

Step-by-Step Solution

Descending alphabetical order is zebra, tiger, lion, bear. Step 1 moves 'zebra' left: zebra lion bear tiger. Step 2 moves 'tiger' next: zebra tiger lion bear.
Answer: D) zebra tiger lion bear

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 rearranges a line of numbers; in each step it moves the smallest number not…A machine rearranges a line of numbers; in each step it moves the largest number not yet…A machine rearranges words; in each step it moves the word that comes earliest in…A machine rearranges words; in each step it moves the word that comes last in dictionary…A machine rearranges numbers; in each step the smallest number not yet fixed moves to…