Tap here to switch tabs
Problem
Submissions

Problem: Count Residue Prefixes

med
30 min
Try to solve the Count Residue Prefixes problem.

Statement

You are given a string s.

A prefix of s is called a residue prefix if the number of distinct characters in the prefix is equal to the length of the prefix modulo 33.

Return the total number of residue prefixes of s.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • s contains only lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Residue Prefixes

med
30 min
Try to solve the Count Residue Prefixes problem.

Statement

You are given a string s.

A prefix of s is called a residue prefix if the number of distinct characters in the prefix is equal to the length of the prefix modulo 33.

Return the total number of residue prefixes of s.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • s contains only lowercase English letters.