Practice30Create account

An arrangement machine reshuffles an input line by reversing a block of elements at the left end, one block per step. In Step 1 it reverses the order of the first two elements, in Step 2 the first three elements, in Step 3 the first four, and so on, each step reversing one element more than the step before. Nothing is added to or taken out of the line, and the machine stops after the step that reverses the whole line.
Input: 34 pearl 61 vine 27 dome.
Which of the following is Step 3 of the above arrangement?

Competition practiceInput-Output
  • A61 34 pearl vine 27 dome
  • B27 61 34 pearl vine dome
  • Cvine 61 pearl 34 27 dome
  • Dvine pearl 34 61 27 dome

Step-by-Step Solution

Each step works on the line the previous step produced. Step 1 reverses the first two: pearl 34 61 vine 27 dome. Step 2 reverses the first three of that: 61 34 pearl vine 27 dome. Step 3 reverses the first four of that: vine pearl 34 61 27 dome. Stopping one step short gives 61 34 pearl vine 27 dome, and running one step too far gives 27 61 34 pearl vine dome. The subtle slip is to reverse the first four elements of the original input, 34 pearl 61 vine, which yields vine 61 pearl 34 27 dome — the same six elements, but the two earlier flips have been forgotten.
Answer: D) vine pearl 34 61 27 dome

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