Equivalent Subarrays
medium
1. You are given an array of integers(arr). 2. You have to find the count of equivalent subarrays. 3. A subarray is equivalent if, count of unique integers in the subarray = count of unique integers in the given array.
Constraints
1 <= N <= 10^5 -2^31 <= arr[i] <= 2^31-1
Format
Input
A number N arr1 arr2... N numbers
Output
A number representing count of equivalent subarrays.
Example
Sample Input
5
2 1 3 2 3
Sample Output
5
Question Video