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 looks at the words that contain a double letter — the same letter twice in a row — and takes the one standing furthest to the left among those not already shifted, placing it at the extreme left end of the line. Words with no double letter, and all the numbers, are never shifted; every other element keeps its relative position, and the machine stops once every double-letter word has been shifted.
Input: 63 mango 27 butter 45 orchid 81 collar 19.
In Step 2 of the above arrangement, which element stands immediately to the right of "orchid"?

Competition practiceInput-Output
  • A81
  • B45
  • C19
  • Dcollar

Step-by-Step Solution

Butter has tt and collar has ll; mango and orchid have no double letter and stay put. Step 1: butter 63 mango 27 45 orchid 81 collar 19. Step 2: collar butter 63 mango 27 45 orchid 81 19. Orchid is followed immediately by 81. The number 45 sits immediately to its left, not its right; 19 is two places further on; and collar has been carried to the far left end, nowhere near orchid.
Answer: A) 81

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

An arrangement machine reshuffles an input line by reversing a block of elements at the…An arrangement machine reshuffles an input line by reversing a block of elements at the…An arrangement machine reshuffles an input line by reversing a block of elements at the…An arrangement machine reshuffles an input line by reversing a block of elements at the…An arrangement machine reshuffles an input line by reversing a block of elements at the…