Problem statement.
"....a string is good if you can obtain an anagram of the string p from it, replacing the "?" characters by Latin letters....."
Does it mean if I can obtain an anagram of p without replacing "?" characters a good string? I think no. What do you guys think?
My contest submission gets WA on pretest 4 because I didn't count those good strings but I got AC with this.
One way of looking at it is, "bba" can be obtained by replacing all "?" in "bba" ( just that there are no "?" present ). May be they could have added in brackets, " ( possibly none ) ", but come on.. this is very much understandable. Its tough for translators to guess all possible interpretations. I think they have improved a lot these days.