The algorithm counts the number of substrings of a given string that contain at most k distinct characters. This is the solution to the problem described in the original text.
Tigre · Acqua Marinas · Rincon De Milberg · Rincon de Milberg · Buenos Aires