Help with GRANAMA

https://www.codechef.com/viewsolution/16029520 I can’t seem to find the mistake in my solution for granama.Please help

This

Input
1
abcz abcc
Your output
NO
Expected Output
YES

Chef will correctly classify them as non granama due to presence of z in one of them.

Look at my solution

It’s very simple https://www.codechef.com/viewsolution/16029943

Just print “no” if the 2 strings are not equal and set of strings is also not equal else print “yes”