Tap here to switch tabs
Problem
Submissions

Problem: Optimal Partition of String

Optimal Partition of String asks you to split a string into contiguous substrings with no repeated character in any part, returning the fewest substrings needed.

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

Optimal Partition of String asks you to split a string into contiguous substrings with no repeated character in any part, returning the fewest substrings needed.

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.