Equivalent Sub-Arrays
Submissions: 629   Accuracy:

49.93%

  Difficulty: Basic   Marks: 1

Given an array of n integers. Count the total number of sub-array having total distinct elements same as that of total distinct elements of the original array.

Input:
The first line of input contains an integer T denoting the number of test cases. Each test case contains
the number of elements in the array a[] as n and next line contains space separated n elements in
the array.

Output:
For each test case output an integer which is the required answer.

Constraints:
1<=T<=100
1<=n<=100
1<=a[i]<=100

Example:
Input:

3
5
2 1 3 2 3
5
2 4 5 2 1
5
2 4 4 2 4
Output:
5
2
9

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Shashwat Jain
Author: shashwat jain


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.