#include
using namespace std;
int main() {
int n,num,ans=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>num;
ans^=num;
}
cout<<ans<<" is present only once";
return 0;
}
Test cases failing
Hi… why are u unnecessarily printing this " is present only once";
https://ide.codingblocks.com/s/610464 I have corrected ur code… its passing all test cases now…
confused the required output with explanation
i hope ur doubt is cleared now??
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.