SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
47 stars 132 forks source link

XOR Equal #438

Closed nobita851 closed 2 years ago

nobita851 commented 2 years ago

Codechef problem: XOR Equal

(C++ Solution contributors)


Issue Id you have worked upon -

182

Briefly explain your program logic -

Used basic properties of XOR

A xor B xor B = A
A xor 0 = A
A xor A = 0

Also used to map to calculate frequencies of different elements in given array

Screenshots-

image

image


Checklist:

All the conditions should be fulfilled for considering your code for merging -