Practice30Create account

A word-and-number arrangement machine, when given an input line of words and numbers, rearranges it in steps. In each step the machine takes the word that comes first in alphabetical order among the unshifted words that begin with a vowel, and places it at the extreme left end of the line. Once no unshifted word begins with a vowel, it takes the word that comes first in alphabetical order among the words that remain and places it at the extreme left end in the same way. Every other element keeps its relative position, and the machine stops once every word has been shifted.
Input: 52 tiger 18 amber 47 ocean 33 flute.
Which of the following is Step 2 of the above arrangement?

Competition practiceInput-Output
  • Aflute amber 52 tiger 18 47 ocean 33
  • Bamber ocean 52 tiger 18 47 33 flute
  • C52 tiger 18 47 33 flute amber ocean
  • Docean amber 52 tiger 18 47 33 flute

Step-by-Step Solution

Amber and ocean begin with vowels, so they are dealt with before tiger and flute; among the two, amber comes first alphabetically. Step 1: amber 52 tiger 18 47 ocean 33 flute. Step 2: ocean amber 52 tiger 18 47 33 flute. Ignoring the vowel rule and going by plain alphabetical order would send flute out second and open the line with flute amber. The other two lines keep the right pair of words but put ocean to the right of amber, or send both words to the right end of the line instead of the left.
Answer: D) ocean amber 52 tiger 18 47 33 flute

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, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…An arrangement machine reshuffles an input line by interchanging one pair of elements…