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
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.
bruceewayne | 160 |
manvirag982 | 134 |
Core_Ka_Bachha | 133 |
rajupraaa1234 | 131 |
vinu_ramanan | 123 |
mr_kksparrow | 433 |
manvirag982 | 350 |
rajupraaa1234 | 266 |
Exception_404 | 250 |
PranathiBhuvanagiri | 242 |
blackshadows | 5331 |
Ibrahim Nash | 5219 |
akhayrutdinov | 5111 |
mb1973 | 4929 |
Quandray | 4567 |