Count the Number of Good Partitions
Count partitions where no value appears in two different subarrays, using a prefix DP over closed segments.
Count partitions where no value appears in two different subarrays, using a prefix DP over closed segments.