We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent abd9d10 commit 1d60092Copy full SHA for 1d60092
Tree2.cpp
@@ -0,0 +1,28 @@
1
+#include <iostream>
2
+#include<algorithm>
3
+using namespace std;
4
+
5
+int main() {
6
+ // your code goes here
7
+ int t;
8
+ cin>>t;
9
10
+ while(t--){
11
+ int n;
12
+ cin>>n;
13
+ int arr[n];
14
15
+ for(int i=0;i<n;i++){
16
+ int a;
17
+ cin>>a;
18
+ arr[i]=a;
19
+ }
20
21
+ sort(arr,arr+n);
22
+ int count=0;
23
+ for(int i=0;i<n-1;i++){
24
+ if(arr[i]!=arr[i+1]){
25
+ count++;
26
27
28
0 commit comments