Update appNew update is available. Click here to update.
About
Government Polytechnic, Chapra 2022
C++ - Default language
My Stats
EXP gained
yellow-spark
1130
Level
5 (Champion)
Community stats
Discussions
0
Upvotes
0
Know more
31
Total problems solved
21
Easy
7
Moderate
3
Hard
0
Ninja
Jan Jan Feb Feb Mar Mar Apr Apr May May Jun Jun Jul Jul Aug Aug Sep Sep Oct Oct Nov Nov Dec Dec

Current streak:

0 days

Longest streak:

1 day

Less

More

Discussions
Using XOR Operator (Bit-Manipulation), Test Case 11/11 Clear
Interview problems

int findDuplicate(vector<int> &arr) 

{

   

   //Instagram: @md_azad

   int key = 0;

    for(int  i= 0;   i<arr.size();   i++){

       key = key ^ arr[i];

    }

     for(int  i = 1;   i<arr.size();   i++){

       key = key ^ i;

    }

   return key;

}

 

profile
modest_azad
Published On 19-Oct-2023
124 views
3 replies
0 upvotes