Can anyone help me with the approach of this question?
If you are referring to this problem : Silly Sort Then this article will surely help you