Help me in solving DSSA41 problem

My issue

i have typed correct code but it seems showing error still

My code

t = int(input())
for _ in range(t):
    n=int(input())
    a=list(map(int,input().split()))
    
    a.sort()
    if n%2==0:
        count= n // 2
    else:
        count= n // 2 + 1
    i= n // 2
    while i > 0:
        if a[i] == a[i - 1]:
            count = count+1
            i = i-1
    else:
        break
    print(count)
    # update the code below to solve this problem
    

Learning course: Kalasalingam Academy of Research and Education
Problem Link: CodeChef: Practical coding for everyone

I am unable to view the question but by looking at the code i think the error is in the indentation of the else statement. The else should be in the same indent as of the above if statement which is inside the while loop.