write a go solution for C. Cool Partitiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYousef has an array a of size n. He wants to partition the array into one or more contiguous segments such that each element a_i belongs to exactly one segment.A partition is called cool if, for every segment b_j, all elements in b_j also appear in b_j+1 (if it exists). That is, every element in a segment must also be present in the segment following it.For example, if a=[1,2,2,3,1,5], a cool partition Yousef can make is b_1=[1,2], b_2=[2,3,1,5]. This is a cool partition because every element in b_1 (which are 1 and 2) also appears in b_2. In contrast, b_1=[1,2,2], b_2=[3,1,5] is not a cool partition, since 2 appears in b_1 but not in b_2.Note that after partitioning the array, you do not change the order of the segments. Also, note that if an element appears several times in some segment b_j, it only needs to appear at least once in b_j+1.Your task is to help Yousef by finding the maximum number of segments that make a cool partition.InputThe first line of the input contains integer t (1<=t<=10^4) — the number of test cases.The first line of each test case contains an integer n (1<=n<=2*10^5) — the size of the array.The second line of each test case contains n integers a_1,a_2,...,a_n (1<=a_i<=n) — the elements of the array.It is guaranteed that the sum of n over all test cases doesn't exceed 2*10^5.OutputFor each test case, print one integer — the maximum number of segments that make a cool partition.ExampleInput861 2 2 3 1 581 2 1 3 2 1 3 255 4 3 2 1105 8 7 5 8 5 7 8 10 931 2 293 3 1 4 3 2 4 1 264 5 4 5 6 481 2 1 2 1 2 1 2Output2 3 1 3 1 3 3 4 NoteThe first test case is explained in the statement. We can partition it into b_1=[1,2], b_2=[2,3,1,5]. It can be shown there is no other partition with more segments.In the second test case, we can partition the array into b_1=[1,2], b_2=[1,3,2], b_3=[1,3,2]. The maximum number of segments is 3.In the third test case, the only partition we can make is b_1=[5,4,3,2,1]. Any other partition will not satisfy the condition. Therefore, the answer is 1.. Output only the code with no comments, explanation, or additional text.