Discussion of Question with ID = 014 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.

Advertisement

Question

"balm urea pack 63 56 67 45 lack" is re-arranged according to a particular rule, in the steps mentioned below.

  1. balm 67 pack 63 56 urea 45 lack
  2. balm 67 lack 63 56 urea 45 pack
  3. balm 67 lack 63 pack urea 45 56
  4. balm 67 lack 63 pack 56 45 urea
  5. balm 67 lack 63 pack 56 urea 45

If an input is: fade 31 verb 12 cage 40 pack 99, 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 fade 31 verb 12 cage 40 pack 99:

  1. cage 31 verb 12 fade 40 pack 99
  2. cage 99 verb 12 fade 40 pack 31
  3. cage 99 fade 12 verb 40 pack 31
  4. cage 99 fade 40 verb 12 pack 31
  5. cage 99 fade 40 pack 12 verb 31
  6. cage 99 fade 40 pack 31 verb 12

Comments and Discussion