Issue with HTMLTAGS problem

for t in range(int(input())):
a=input()
i=-1;j=0
for m in a:
i+=1
if m=="<" and i==0 or m=="/" and i==1 or m==">" and i==len(a)-1:
j+=1
if j==3:
k=1;indi=0
for r in range(len(a)-2):
k+=1
if k==len(a)-1:
break
if ord(a[k])>=97 and ord(a[k])<=122 or ord(a[k])>=48 and ord(a[k])<=57:
continue
else:
print(“Error”)
indi+=1
break
if indi==0:
print(“Success”)
else:
print(“Error”)
https://www.codechef.com/viewsolution/48206960

in this code for the problem HTMLTAGS my code is correct but if u copy paste the input from the site then it will give the wrong answers but if you manually give the input by typing then it will give the right answers and this should not happen please help!!

that’s because when you copy post from the site you copy additional space also which changes your string and that’s the reason for incorrect input you can use rstrip with input if you want to ignore input or you can manually enter them .
This is the problem with cf that they don’t allow to copy input like codeforces

2 Likes

then why my submission is wrong ? at least after submitting the code… there they should have given AC because there I don’t think while feeding the input by the site , there should not be any extra spaces given by it isn’t it?

1 Like
1
</>

(hopefully the forum software hasn’t added any spaces in).