# Discussion of Question with ID = 053 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

"pace 70 41 06 67 vice walk xylo" is re-arranged according to a particular rule, in the steps mentioned below.

1. pace 70 vice 06 67 41 walk xylo
2. pace 70 vice 67 06 41 walk xylo
3. pace 70 vice 67 walk 41 06 xylo
4. pace 70 vice 67 walk 41 xylo 06

If an input is: game 34 obey cage 99 37 cafe 96, then how many steps are required if re-arrangement is done according to the above rule?

A

6

B

5

C

4

D

7

Soln.
Ans: a

In each step, English words and numbers are alternately being arranged. Strings are in ascending order, and numbers are in descending order. An English word is placed, then a number, and so on. These are the steps for re-arrangement starting with game 34 obey cage 99 37 cafe 96:

1. cafe 34 obey cage 99 37 game 96
2. cafe 99 obey cage 34 37 game 96
3. cafe 99 cage obey 34 37 game 96
4. cafe 99 cage 96 34 37 game obey
5. cafe 99 cage 96 game 37 34 obey
6. cafe 99 cage 96 game 37 obey 34