Advertisement
Question
"pace 70 41 06 67 vice walk xylo" is re-arranged according to a particular rule, in the steps mentioned below.
- pace 70 vice 06 67 41 walk xylo
- pace 70 vice 67 06 41 walk xylo
- pace 70 vice 67 walk 41 06 xylo
- 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
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:
- cafe 34 obey cage 99 37 game 96
- cafe 99 obey cage 34 37 game 96
- cafe 99 cage obey 34 37 game 96
- cafe 99 cage 96 34 37 game obey
- cafe 99 cage 96 game 37 34 obey
- cafe 99 cage 96 game 37 obey 34