Practice30Create account

An arrangement machine reorders an input line of words and numbers one step at a time. Every step moves two words at once — the leftmost word still in place that begins with a vowel travels to the far left, while the rightmost one still in place that begins with a consonant travels to the far right. Should only one kind remain, that step moves just that word. Numbers never move, and the machine halts once every word has moved.
Input: umesh 53 nisha 27 omkar tara 68.
In Step 2 of the above arrangement, which element is fourth from the left end?

Competition practiceInput-Output
  • A53
  • B27
  • C68
  • Domkar

Step-by-Step Solution

Step 1 sends umesh to the left end (where it already stood) and tara, the rightmost consonant word, to the right end: umesh 53 nisha 27 omkar 68 tara. Step 2 sends omkar to the left end and nisha to the right end: omkar umesh 53 27 68 tara nisha. Counting from the left — omkar, umesh, 53, 27 — the fourth element is 27. "53" is third from the left, an off-by-one count. "68" is fifth. "omkar" is first from the left and fourth only if the line of Step 1 is used instead of Step 2.
Answer: B) 27

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,…An arrangement machine works on an input line having an odd number of elements. In each…A word-and-number arrangement machine, when given an input line of words and two-digit…An arrangement machine reorders an input line of words and numbers one step at a time.…