Easy Peasy

Given an array of integers, find the number of the segments of the array without repeating integers in the segment. For example, number of the segments of the array without repeating letters for {1,2,1} is 5. In 0 based indexing, these segments are (0,1), (1,2), (0), (1), (2). Input Input starts with T (≤ 20), the number of test cases to follow. For each test case, in the first line one integer N (1 ≤ N ≤ 100000) is given. N is the number of integers in the array. In the next line N integers separated by space is given. i-th integer will be arr[i] (0 ≤ arr[i] ≤ 1000000000). Output For each case, print the number of the segments of the array without repeating integers in the segment. Sample Input 2 3 121 5 12312 Sample Output 5 12