Sample Input
5
1 2 1 2 3
Output?
Sample Input
5
1 2 1 2 3
Output?
n = 5 so there will be (n*(n+1))/2
e.g . n = 2 array - {1,1}
total subarray 3
1
1
1 , 1
only 1st and 2nd subarray have all elements distinct and there length is 1 so sum of length = 2
ans = 2
and bdw Q is pretty clear and no ambiguity is there in the Q. thanks