Logic which I used to find anagram is as following
first I stored characters of first string in empty array
then I checked one by one if the characters of string2 is present already present in arr which i created
if yes then remove if no then append
at the end if whole of the array is empty then yes string is anagram else not
t=int(input())
for i in range(t):
n1=input()
n2=input()
arr=[]
for ch in n1:
arr.append(ch)
for ch in n2:
if ch in arr:
arr.pop(ch)
else:
arr.append(ch)
if arr==[]:
print("yes")
else:
print("no")
with this code the error is comming out to be
TypeError: 'str' object cannot be interpreted as an integer how do i rectify this error