Available question text
Given a string s and integer k, you may change at most one character; then repeatedly remove the longest prefix that contains at most k distinct letters, counting each removal as a partition. Return the maximum number of partitions obtainable by choosing the optimal single-character change to maximize these greedy k-distinct-prefix splits.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3003. Maximize the Number of Partitions After Operations
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source