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: 36 quartz 72 island 15 acorn 48 velvet.
At which step of the above arrangement does the line "velvet quartz island acorn 36 72 15 48" appear?

Competition practiceInput-Output
  • AStep 4
  • BStep 3
  • CStep 2
  • DStep 1

Step-by-Step Solution

Acorn and island begin with vowels and go first, acorn before island; quartz and velvet follow alphabetically. Step 1: acorn 36 quartz 72 island 15 48 velvet. Step 2: island acorn 36 quartz 72 15 48 velvet. Step 3: quartz island acorn 36 72 15 48 velvet. Step 4: velvet quartz island acorn 36 72 15 48 — the line asked about, and the last one, since all four words have been shifted. The tell is that no word is left standing among the numbers.
Answer: A) Step 4

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,…An arrangement machine reshuffles an input line by interchanging one pair of elements…An arrangement machine reshuffles an input line by interchanging one pair of elements…An arrangement machine reshuffles an input line by interchanging one pair of elements…An arrangement machine reshuffles an input line by interchanging one pair of elements…