Available question text
Count the number of ways to split an array into contiguous parts so that all occurrences of each value lie inside a single part; this reduces to computing each value's span [first,last], merging overlapping spans into K inseparable blocks, and the answer is 2^(K-1) mod 1e9+7.
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 2963. Count the Number of Good Partitions
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source