Help me in solving CS2023_STK problem

My issue

the output is correct but it’s showing runtime error

My code

# cook your dish here
t=int(input())
for i in range(t):
    N=int(input())
    A=list(map(int,input().split()))
    B=list(map(int,input().split()))
    a=0
    o=0
    t1=0
    t2=0
    l1=[]
    l2=[]
    for k in range(N):
        if A[k]>0:
            t1+=1
            l1.append(t1)
        else:
            t1=0
    a=max(l1)
    
    for j in range(N):
        if B[j]>0:
            t2+=1
            l2.append(t2)
        else:
            t2=0
    o=max(l2)
    
    if a>o:
        print("Om")
    elif a==o:
        print("Draw")
    else:
        print("Addy")
        
        
            
        
        
        

Learning course: Arrays using Python
Problem Link: CodeChef Streak Practice Problem in - CodeChef

@meghasyam21
u have to take care of the case when we don’t get any 0 in the array.
plzz refer the following solution

# cook your dish here
# cook your dish here
for i in range(int(input())):
    n=int(input())
    a=list(map(int,input().split()))
    b=list(map(int,input().split()))
    A=[]
    B=[]
    p=0
    q=0
    for x in a:
        if x==0:
            A.append(p)
            p=0
        else:
            p+=1
    for x in b:
        if x==0:
            B.append(q)
            q=0
        else:
            q+=1
    A.append(p);
    B.append(q);
    if max(A)>max(B):
        print('Om')
    elif max(A)==max(B):
        print('Draw')
    else:
        print('Addy')