Can't Find Logic

I am unable to crack any logic

hi @atharv26500 we are given initial string like 12345, so we can give places to every digit, like in this case we will say that 5 is on 1st place, 4 is on 2nd place and so on. Now we just have to invert this relationship so if 5 was on 1st place, after inverting this relationship 1 would be on 5th place.

Before Inverse

Places --> 5 4 3 2 1
Value ---> 3 2 1 4 5

After Inverse

Places --> 5 4 3 2 1
Value ---> 1 2 5 4 3

We can see in this example before inverse 4 was on 2nd place and after inverse 2 moved to 4th place.

hi @atharv26500
do u still face any difficulty as I can see that u have successfully submitted the code and gained full score…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.