My issue
please help me to understand the question
My code
#include <stdio.h>
int main(void) {
// your code goes here
}
Problem Link: Candies Practice Coding Problem - CodeChef
please help me to understand the question
#include <stdio.h>
int main(void) {
// your code goes here
}
Problem Link: Candies Practice Coding Problem - CodeChef
@vardhankorada2
plzz refer my c++ code for better understanding of the logic
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
int size = 2 * n;
int a[size];
for (int i = 0; i < size; i++)
{
cin >> a[i];
}
sort(a,a+size);
string s = "YES";
for (int i = 0; i < size-2; i++)
{
if(a[i]==a[i+1] && a[i+1]==a[i+2]){
s="NO";
}
}
cout<<s<<"\n";
}
return 0;
}