Practice30Create account

A word-and-number arrangement machine, when given an input line of words and numbers, rearranges it in steps. In each step two shifts happen together: the smallest odd number not already shifted is taken out and placed at the extreme left end of the line, and at the same time the largest even number not already shifted is taken out and placed at the extreme right end. If only one of the two kinds is still left, that step makes only that one shift. Every other element keeps its relative position, and the machine stops once every number has been shifted.
Input: 84 raven 37 sable 62 thorn 15 umber 49.
In Step 2 of the above arrangement, which element is fourth from the left end?

Competition practiceInput-Output
  • Araven
  • Bsable
  • Cthorn
  • Dumber

Step-by-Step Solution

Odd numbers: 37, 15, 49. Even numbers: 84, 62. Step 1 sends 15 to the extreme left and 84 to the extreme right: 15 raven 37 sable 62 thorn umber 49 84. Step 2 sends 37 left and 62 right: 37 15 raven sable thorn umber 49 84 62. Counting from the left: 37, 15, raven, sable — so sable is fourth. Stopping a place short gives raven and going a place past gives thorn, while counting from the right end instead gives umber.
Answer: B) sable

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,…A word-and-number arrangement machine, when given an input line of words and numbers,…