You are viewing a single comment's thread. Return to all comments →
Was able to run only 3 test cases and could not figure out the defect in the code
void countApplesAndOranges(int s, int t, int a, int b, int apples_count, int* apples, int oranges_count, int* oranges) { int aple=0,orng=0,num; for(num=0;num<apples_count;num++){ if((a+apples[num])>=s) aple++; } for(num=0;num<oranges_count;num++){ if((b+oranges[num])<=t) orng++; } printf("%d\n%d",aple,orng); }
Seems like cookies are disabled on this browser, please enable them to open this website
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
Was able to run only 3 test cases and could not figure out the defect in the code