Why i am getting Nzec

for i in range(int(input())):
x=input()
x=int(x)
s=str(input())
u=str(input())
k=int(0)
j=int(0)
while j<(x-1):

    if(s[j]==u[j]):
        k=k+1
        j=j+1
    if(u[j]=='N'):
        j=j+1    
    if((u[j]!=s[j])and(u[j]!='N')):
        
        j=j+2
      
if(s[len(s)-1]==u[len(s)-1]):
    k=k+1

    
print(int(k))

I think you didn’t intent correctly.Refer to this solution: https://www.codechef.com/viewsolution/24913270