Merge Sort Problem of run error

My code is showing run error only at the time of submitting but it is working correctly on custom input and also working properly on coding blocks ide and jupyter also

def merge(s,e,a=[]):
mid=(s+e)//2
i=s
j=mid+1
temp=[]

while(i<=mid and j<=e):
    if(a[i]<a[j]):
        temp.append(a[i])
        i+=1
    
    else:
        temp.append(a[j])
        j+=1
while(i<=mid):
    temp.append(a[i])
    i+=1
while(j<=e):
    temp.append(a[j])
    j+=1
a[s:e+1]=temp

def mergeSort(s,e,a=[]):
if(s>=e):
return
mid=(s+e)//2
mergeSort(s,mid,a)
mergeSort(mid+1,e,a)

merge(s,e,a)

n=int(input())
b=input()
a=[int(i) for i in b.split(’ ')]
mergeSort(0,n-1,a)
for i in range(len(a)):
print(a[i],end=" ")

Here is my code in python
please anyone help me out

Hello @dhruvgoel297,

If you share your code like this, it will be very hard for us to debug and help you with the problem. Kindly share your code through ide. Also, the challenge as well as the portal is perfectly fine and has no error in itself. If your code isnt working, its because its wrong.
Hence, share your code through IDE.

Thanks :slight_smile:

Here is the link to the program
this is correctly working there but not working in the submission area of challenge

i provided link to the code

Hello @dhruvgoel297,

There problem was with how you read the input. I have updated your code.

It works now.

Happy Learning :slight_smile:
Thanks

it is showing error of EOF when reading a line at line 29 which is:- n=int(input())

Dont run the code. Just submit it. If you are running the code, then provide custom input.

oh soory, just forgot to pass the custom inputs

thanks for the solution