how to solve delhi odd even problem
How to solve delhi odd even
@raj123aryan
hey aryan
For ex if you are given a no.:
982452
then maintain 2 variables evesum=0, oddsum = 0 ;
and they will be:
9 + 8 + 2 + 4 + 5 + 2
evesum = 8 + 2 + 4 + 2 = 16
oddsum = 9 + 5 = 14
if((evesum%4==0)||(oddsum%3==0)){
cout<<“Yes”<<endl;
}else{
cout<<“No”<<endl;
}
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.