Practice30Create account

A word-rearranging machine moves one word per step: in each step the next word in alphabetical order is shifted into the leftmost position not yet fixed, while the remaining words keep their relative order. Example - Input: 'sun tree apple moon'. Step I: 'apple sun tree moon'. Step II: 'apple moon sun tree'. For the input 'orange grape banana lemon', which line is Step II?

Competition practiceInput-Output
  • Agrape banana orange lemon
  • Bbanana grape orange lemon
  • Cbanana orange grape lemon
  • Dbanana grape lemon orange

Step-by-Step Solution

Alphabetical order is banana, grape, lemon, orange. Step I places banana first: 'banana orange grape lemon'. Step II places grape second: 'banana grape orange lemon'.
Answer: B) banana grape orange lemon

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 number-arranging machine moves one number per step: in each step the smallest number…A number-arranging machine moves one number per step: in each step the largest number…A word-rearranging machine moves one word per step: in each step the word that comes…A number-arranging machine moves one number per step: in each step the smallest number…A machine handles both words and numbers each step: the word earliest in alphabetical…