could you temme what is wrong with my code i ran it in some other compiler it worked just fine
Idk what s wrong in my code
@sshreya2912
hello Shreya,
please save ur code on https://ide.codingblocks.com/ and then share the link
it is working fine on other compiler
#include using namespace std; int main() { int n; int a[100000]; cin>>n; int no; int res=0; for(int i=0;i<n;i++) { cin>>no; a[i]=no; res=res^no; } int temp=res; int pos=0; while((temp&1)==0) { pos++; temp=temp>>1; } int mask=1<<pos; int x,y; for(int i=0;i<n;i++) { if((a[i]&mask)>0) x=x^a[i]; } y=res^x; cout<<min(x,y)<<max(x,y); return 0; }
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.