You are viewing a single comment's thread. Return to all comments →
int m = min( min(n1,n2) , min(n2,n3) ); int i; if( m == n1 ){ i = n1-1; while( i>-1 ){ int check = sum1[i]; if( binary_search(sum2.begin(),sum2.end(),check) ==true && binary_search(sum3.begin(),sum3.end(),check) ==true ){ cout << check << endl; break; } else i--; } if(i==-1) cout << "0" << endl; } else if( m == n2 ){ i= n2-1; while( i>-1 ){ int check = sum2[i]; if( binary_search(sum1.begin(),sum1.end(),check) ==true && binary_search(sum3.begin(),sum3.end(),check) ==true ){ cout << check << endl; break; } else i--; } if(i==-1) cout << "0" << endl; } else if( m == n3 ){ i=n3-1; while( i>-1 ){ int check = sum3[i]; if( binary_search(sum2.begin(),sum2.end(),check) ==true && binary_search(sum1.begin(),sum1.end(),check) ==true ){ cout << check << endl; break; } else i--; } if(i==-1) cout << "0" << endl; }
Seems like cookies are disabled on this browser, please enable them to open this website
Equal Stacks
You are viewing a single comment's thread. Return to all comments →