finding rank of the elements(vectors) in reverse wayproblem : "To rank in every possible elements of the set {1,2, ..., n} so that the numbers i, i + 1,...