Tap here to switch tabs
Problem
Submissions

Problem: Maximum Substrings With Distinct Start

Maximum Substrings With Distinct Start asks you to partition a string into as many contiguous substrings as possible, ensuring that each substring begins with a different character.

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

Maximum Substrings With Distinct Start asks you to partition a string into as many contiguous substrings as possible, ensuring that each substring begins with a different character.

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.