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

"81 35 46 61 77 98 49 30" is re-arranged according to a particular rule, in the steps mentioned below.

  1. 30 35 46 61 77 98 49 81
  2. 30 61 46 35 77 98 49 81
  3. 30 61 35 46 77 98 49 81
  4. 30 61 35 81 77 98 49 46
  5. 30 61 35 81 46 98 49 77
  6. 30 61 35 81 46 49 98 77
  7. 30 61 35 81 46 49 77 98

If step 1 of an input is: 23 94 49 36 27 26 74 75, then what is step 2, if re-arrangement is done according to the above rule?

A

23 26 49 36 27 94 74 75

B

23 26 36 27 74 75 49 94

C

23 26 36 49 27 94 74 75

D

23 94 49 36 27 26 74 75

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 23 94 49 36 27 26 74 75:

  • 23 94 49 36 27 26 74 75
  • 23 26 49 36 27 94 74 75
  • 23 26 36 49 27 94 74 75
  • 23 26 36 27 49 94 74 75
  • 23 26 36 27 74 94 49 75
  • 23 26 36 27 74 75 49 94

Comments and Discussion