what is wrong in my code?
# cook your dish here
from collections import Counter
def ans(s,i,j,c=0):
N=len(s)
if 2*i>=len(s):
return c
elif (N-(2*i))%2!=0:
j=(N-2*(i+1))//2
return ans(s,i+1,j,c)
elif 2*i+j<len(s) and s[:int(i)]==s[int(i):int(2*i)] and s[2*i:2*i+j]==s[2*i+j:]:
c+=1
j=(N-2*(i+1))//2
return ans(s,i+1,j,c)
else:
return ans(s,i+1,(N-2*(i+1))//2,c)
def main(s):
d=Counter(s)
for i in d:
if d[i]%2!=0:
return 0
N=len(s)
if N-2>0:
return ans(s,1,(N-2)//2,0)
else:
return 0
t=int(input())
for _ in range(t):
s=str(input())
print(main(s))
```