Https://hack.codingblocks.com/contests/c/509/204

https://hack.codingblocks.com/contests/c/509/204
my solution is :https://ide.codingblocks.com/#/s/27738
problem is that not passing in all the cases in hacker blocks.

  1. Question isnt about reversing the array, it is about finding the inverse of array and checking whether its same as original array or not.
  2. Line 12, single = operator is used that would always give answer True.
  3. Line 30, y>=0 i guess.

give it a try…:smile:

Not clear between inverse and reverse

It is same like in functions(MATHS).

if arr[1]=5, arr[2]=4, arr[3]=1, arr[4]=2, arr[5]=3
then inverse is
inv[5]=1, inv[4]=2, inv[1]=3, inv[2]=4, inv[3]=5

In other words,
A(X)=Y and B(Y)=X then function A and function B are inverse of each other.