We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
hey if anyone is looking here a very basic c++ code in this code I used loops
to first get all the elements in array that divide all the values between max of a and min of b
then I stored those a[]'s in new array that I again run a for loop to found count if all elelments in new array divide elements of array b
here is the code
`
//code written on date:17 aug 2018 hacker rank between two sets problem
include
using namespace std;
int getTotalX(int a [], int b [],int n ,int m) {
int a_max=a[0],b_min=b[0];
Between Two Sets
You are viewing a single comment's thread. Return to all comments →
hey if anyone is looking here a very basic c++ code in this code I used loops to first get all the elements in array that divide all the values between max of a and min of b
then I stored those a[]'s in new array that I again run a for loop to found count if all elelments in new array divide elements of array b
here is the code ` //code written on date:17 aug 2018 hacker rank between two sets problem
include
using namespace std;
int getTotalX(int a [], int b [],int n ,int m) { int a_max=a[0],b_min=b[0];
// cout<=a_max){
} /----------------------------------------------------------------------------/ //cout<<"p:"<
int finalcount=0; for(int i=0; i
}
//cout<<"finalcount"<
}
int main() { int n,m; cin>>n>>m; int a[n],b[m]; for(int i=0; i
cout<
}`