I maintain a little free tool that packs sample data for our workshops. Each exercise gets one slip in a text file. Two exercises can ask for the same thing. Our test sorted both lists with sort -u and swore blind that two biscuits had been packed. The actual bag had one. A nice property of this test is that it also feeds a hundred people on one biscuit.
I'd written a whole counter in shell before somebody showed me comm. Plain sort on each file, same locale for the sorts and the comparison. With comm -23 wanted.sorted packed.sorted the extra copy in wanted comes out on a line by itself. There goes my magnificent patch.