← Back to context

Comment by benibela

5 years ago

I just had a weird bug in a programming competition.

You basically had to sort the English letters that occur in a text according to their frequency descending. Except the one letter that occurs the least, needs to be sorted as if it occurs the most.

The expected output of the sample case was TPFOXLUSHB

I ran my program on the sample, the output looked correctly; then I submitted it, and the judge said it failed the sample case. In fact, it was printing ͲPFOXLUSHB

That nearly looks like the correct output.

I had confused two variables and it was printing the frequency count as codepoint rather than the letter. But such a coincidence that it looks the same