Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t;
- cin>>t;
- while(t--)
- {
- int n;
- cin>>n;
- int arr[n];
- int ok=0;
- for(int i=0; i<n; i++)
- {
- cin>>arr[i];
- for(int j=0; j<i-1; j++)
- {
- if(arr[i]==arr[j])
- ok=1;
- }
- }
- if(ok)
- cout<<"YES"<<endl;
- else cout<<"NO"<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement