i use map to get the freq of each character of a string.
can’t figured out on which test case it is lagging.
Consider this testcase
Consider a scenario where the flag value on the 36th line of your solution is updated to 0. In the next iteration, if the frequency is ODD, then you print NO and break the loop and the flag value is not updated. So, an extra YES will be printed for that test case.
The expected output is:
Your output is:
I made small changes to your code and it got accepted.