Problem 3803 · Easy

Count Residue Prefixes

Grow each prefix one letter at a time, track how many distinct letters it has, and count the prefixes where that count equals the length modulo 3.

Open the interactive visualisation