We define the uniqueness of a sequence as the number of unique numbers in the sequence. For example, the uniqueness of $\{1,2,1,2\}$ is $0$ because there is no unique number, and the uniqueness of $\{5,6,7,6,6\}$ is $2$ because $5$ and $7$ are unique numbers.
You are given a sequence with length $N$. You need to cut it into $M$ parts (each part is a continuous subsequence), and maximize the sum of the uniqueness of the $M$ parts.