➤ Problem Link : 1201B. Zero Array
✅ C++ Solution :
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
int n;
cin>>n;
ll arr[n];
ll val=0,maxi=-1;
for(int i=0;i<n;i++)
{
cin>>arr[i];
val+=arr[i];
if(arr[i]>maxi)
maxi=arr[i];
}
if(val%2==0 && val-maxi>=maxi)
cout<<"YES";
else
cout<<"NO";
}
Thank you for your patience reading. If you enjoyed this post, I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Whatsapp or Facebook.
😇Happy Learning!!
