You are viewing a single comment's thread. Return to all comments →
People are using many techniques but i consider the easiest to be XOR gate.This question is meant to be solved using Xor gate. Here is my Code-
#include <iostream> using namespace std; int main() { int n; cin>>n; int ans=0; for(int i=0;i<n;i++) { int x; cin>>x; ans^=x; } cout<<ans<<endl; }
Seems like cookies are disabled on this browser, please enable them to open this website
Lonely Integer
You are viewing a single comment's thread. Return to all comments →
People are using many techniques but i consider the easiest to be XOR gate.This question is meant to be solved using Xor gate. Here is my Code-