Kaishav65 / Hacktoberfest2023

Join Hactoberfest 2023, Make you Pull Request and contribute to open source. Raise Genuine PRs, Your PRs will be accepted. Don't forget to spread love and if you like give us a ⭐️
25 stars 217 forks source link

Find_Odd_Occurance_XOR.cpp #165

Open ADARSH-863 opened 11 months ago

ADARSH-863 commented 11 months ago

This C++ program finds the number with an odd occurrence in an array using the bitwise XOR operator. By XORing all elements in the array, the program effectively cancels out pairs of the same numbers, leaving behind the element with an odd occurrence. This bitwise operation enables a compact and efficient solution for identifying the number that occurs an odd number of times in the array.