Tap here to switch tabs
Problem
Submissions

Problem: Optimal Partition of String

med
30 min
Try to solve the Optimal Partition of String problem.

Statement

Given a string s, partition it into one or more substrings such that no character appears more than once in any single substring.

Return the minimum number of substrings required to obtain such a partition.

Note: Each character in s must belong to exactly one substring in the partition.

Constraints:

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

  • s consists only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Optimal Partition of String

med
30 min
Try to solve the Optimal Partition of String problem.

Statement

Given a string s, partition it into one or more substrings such that no character appears more than once in any single substring.

Return the minimum number of substrings required to obtain such a partition.

Note: Each character in s must belong to exactly one substring in the partition.

Constraints:

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

  • s consists only of lowercase English letters.