Please can anyone help me out with this code?I am unable to detect the error.
I don’t really know JAVA so can’t debug the code or anything bud here’s my code
#t=int(input()) for _ in range(int(input())): s=input() l=len(s) h=l//2 x=s[:h] y=s[(h+l%2):] if sorted(x)==sorted(y): print("YES\n") else: print("NO\n")
see if you can translate this and find the mistake
Ya thanks a lot,I can understand the code.This is another approach for this program,but actually I wanted to know the flaw in my code.
consider line 42 :
if left is “abb” and right is “bba”
you are comparing freq of ‘a’ with freq of ‘b’
which is wrong.
Ya,it executed.Thanks a lot!!