Cannot figure out how to approach this question… how to start it?
How to approach
hi @Riya-Verma-1207263756078812,
Logic: Inverse is Simply swapping the value of the array with the value at that index.
- Create a new Array say narr and original array is arr.
- now at the arr[i]th index of narr save the ith value.(previously i is the index and arr[i] is the value bt now arr[i] is the index and i is the value.)
- print new array.
refer here https://ide.codingblocks.com/s/661572