Open creativeyashi opened 3 years ago
`#include
using namespace std;
void solve(int a[],int b[],int n,int m)
{
set
for(int i=0;i<m;i++)
{
s.insert(b[i]);
}
set
}
int main() { int n,m; cin>>n>>m; int a[n],b[m]; for(int i=0;i<n;i++) { cin>>a[i]; } for(int i=0;i<m;i++) { cin>>b[i]; } solve(a,b,n,m);
return 0;
} `
Can I try this in python ?
yo can work on it @creativeyashi
`#include
include
using namespace std;
void solve(int a[],int b[],int n,int m) { set s; for(int i=0;i<n;i++) { s.insert(a[i]); } for(int i=0;i<m;i++) { s.insert(b[i]); } set::iterator it; for(it=s.begin();it!=s.end();++it) { cout<<*it<<" "; } cout<<"\n";
}
int main() { int n,m; cin>>n>>m; int a[n],b[m]; for(int i=0;i<n;i++) { cin>>a[i]; } for(int i=0;i<m;i++) { cin>>b[i]; } solve(a,b,n,m);
return 0;
} `
this is now a way to share code .this is opensource program
Can I try this in python ?
you can create a new issue and mention it that you like to code in python
Please assign this to me. I can do it for C language
Given two sorted arrays, find their union. Example:
Input : arr1[] = {1, 3, 4, 5, 7} arr2[] = {2, 3, 5, 6} Output : Union : {1, 2, 3, 4, 5, 6, 7}
It finds the union of two sorted arrays.
Problem link: https://practice.geeksforgeeks.org/problems/union-of-two-arrays3538/1
Programming language
Kindly assign it to me under LGMSOC'21