i have some ques
1> we have to use map or unodered map
2> we have to make mapping like num->pos
or its reverse
3> traversing from num =n to 1 we can find the best pos for the ith num by n- num than we can easily assign a best pos to the current num but how we will came to know that which num is earlier linked with that pos and to whom to swap with,
plz ans it in detail …