https://online.codingblocks.com/app/player/37108/content/36651/4943?tab=submissions
I am not abble to find out any error
@Jitu748
The problem is with your array allocation. Either allocate it statically with a large size like 100000 or something.
int arr[100000] ;
Or if you wish to allocate it of the exact size n , then allocate it as
int *arr = new int[n] ;
What you are doing in your code is a mixture of both and will not give you benefits of either.