[LeetCode] Count the Number of Good Partitions

1 · · Dec. 10, 2023, 3:10 a.m.
10034. Count the Number of Good Partitions You are given a 0-indexed array nums consisting of positive integers. A partition of an array into one or more contiguous subarrays is called good if no two subarrays contain the same number. Return the total number of good partitions of nums. Since the answer may be large, return it modulo 109 + 7. ...