Tap here to switch tabs
Problem
Submissions

Problem: Maximum Substrings With Distinct Start

Try to solve the Maximum Substrings With Distinct Start problem.

Statement

Given a string s, partition it into the maximum number of contiguous substrings such that every substring starts with a distinct character.

Return the maximum number of substrings that can be obtained from such a partition.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Substrings With Distinct Start

Try to solve the Maximum Substrings With Distinct Start problem.

Statement

Given a string s, partition it into the maximum number of contiguous substrings such that every substring starts with a distinct character.

Return the maximum number of substrings that can be obtained from such a partition.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists of lowercase English letters.