What is meant by inverted array? Because the sample input and output just show the same array printed with spaces
Didn't understand the question
inverting a array mean
if in original array arr[i] is at ith position then
in inverted array i will be present at arr[i] th position
consider this example
5
4
0
2
3
1
4 is at 0st position so in ans Array 0 will be at 4th position
similarly
0 is at 1st position so in ans Array 1 will be at 0th position
2 is at 2st position so in ans Array 2 will be at 2th position
1 is at 4st position so in ans Array 4 will be at 1th position
Sample Output
1 4 2 3 0
i hope now question is clear
this code is completely wrong
even it doesn’t pass this simple example
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.