Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2963. Count the Number of Good Partitions
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.