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

"04 86 22 15 90 81 28 97" is re-arranged according to a particular rule, in the steps mentioned below.

1. 04 22 86 15 90 81 28 97
2. 04 22 15 86 90 81 28 97
3. 04 22 15 90 86 81 28 97
4. 04 22 15 90 81 86 28 97
5. 04 22 15 90 81 28 86 97

If step 5 of an input is: 43 36 54 64 38 65 99 69, then what is step 6, if re-arrangement is done according to the above rule?

A

43 36 54 64 38 65 69 99

B

43 36 54 65 99 69 38 64

C

43 36 69 65 99 54 38 64

D

43 36 54 64 38 65 99 69

Soln.
Ans: a

In each step, the numbers whose sum of digits is smallest are being moved to the left. If the sum is equal, then the number on the left is given preference. These are the steps for re-arrangement starting with 43 36 54 64 38 65 99 69:

• 43 36 54 64 38 65 99 69
• 43 36 54 64 38 65 69 99