Skip to content

Commit

Permalink
Create Tree2.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
sans242 authored Oct 22, 2020
1 parent abd9d10 commit 1d60092
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Tree2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <iostream>
#include<algorithm>
using namespace std;

int main() {
// your code goes here
int t;
cin>>t;

while(t--){
int n;
cin>>n;
int arr[n];

for(int i=0;i<n;i++){
int a;
cin>>a;
arr[i]=a;
}

sort(arr,arr+n);
int count=0;
for(int i=0;i<n-1;i++){
if(arr[i]!=arr[i+1]){
count++;
}
}

0 comments on commit 1d60092

Please sign in to comment.