Discussion of Question with ID = 008 under Passwords-and-Inputs

This is the discussion forum for this question. If you find any mistakes in the solution, or if you have a better solution, then this is the right place to discuss. A healthy discussion helps all of us, so you are requested to be polite and soft, even if you disagree with the views of others. The question and its current solution has also been given on this page.

Question

"gate dark laid 23 83 34 sand 44" is re-arranged according to a particular rule, in the steps mentioned below.

1. gate 44 dark laid 23 83 34 sand
2. gate sand 44 dark laid 23 83 34
3. gate 34 sand 44 dark laid 23 83
4. gate 83 34 sand 44 dark laid 23
5. gate 23 83 34 sand 44 dark laid
6. gate laid 23 83 34 sand 44 dark
7. gate dark laid 23 83 34 sand 44
8. gate 44 dark laid 23 83 34 sand

Which of the following steps would read as "28 41 rank idle kilo 27 23 king" if the input is "28 27 23 king 41 rank idle kilo", and the re-arrangement is done according to the above rule?

A

4

B

5

C

2

D

3

Soln.
Ans: a

In each step, the last item goes to position 1. These are the steps for re-arrangement starting with 28 27 23 king 41 rank idle kilo:

1. 28 kilo 27 23 king 41 rank idle
2. 28 idle kilo 27 23 king 41 rank
3. 28 rank idle kilo 27 23 king 41
4. 28 41 rank idle kilo 27 23 king
5. 28 king 41 rank idle kilo 27 23
6. 28 23 king 41 rank idle kilo 27
7. 28 27 23 king 41 rank idle kilo
8. 28 kilo 27 23 king 41 rank idle