Can we solve this using the simple ‘reverse’ method…if not then how should we implement this.
https://online.codingblocks.com/app/player/246132/content/235743/4784/code-challenge
Can we solve this using the simple ‘reverse’ method…if not then how should we implement this.
https://online.codingblocks.com/app/player/246132/content/235743/4784/code-challenge
hi @
Inverse is basically inverting the places of any number with its value.
For e.g…,
Before Inverse
eg : 32145 answer is 12543
here u have got the place of numbers in input
for 1 is 5
for 2 is 4
for 3 is 1
for 4 is 2
and for 5 is 3
just place them in this order 12543
After Inverse
1.Declare a Place variable that will keep track of the place number for which we are processing the work.
2.The value can be extracted by performing modulus operator on the given number.
3.In order to inverse the place and the number extracted in points 1 and 2 multiply the place with 10 ^ (rem - 1).
For e.g…, Place = 4 and rem = 3, then multiply place with 100 viz, ( 10 ^ (rem - 1)). 4.Add the number to the previous ans.
for implementation difficulties refer https://ide.codingblocks.com/s/662530