Not able to approach

I am not able to approach the question and write the code
can u plz explain in a simple way and also provide that code

hi @yashshuklacoder 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.

u can refer my code --> https://ide.codingblocks.com/s/643000

here array is being used but that has not been taught in course till now should I skip this question and come back after studying that topic?

hi @yashshuklacoder
its better to skip this ques for now, after covering arrays come back here…

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.