- Count Complete Subarrays in an Array
You are given an array nums consisting of positive integers.
We call a subarray of an array complete if the following condition is satisfied:
The number of distinct elements in the subarray is equal to the number of distinct elements in the whole array. Return the number of complete subarrays.
A subarray is a contiguous non-empty part of an array.