Simplified C01P01.

Instead of counting the number of appearances, just check if a character appeared before.