In the explanation of the given problem, bhaiya just said that take modulus of 3, however why is that, what’s the logical implementation behind taking modulo by 3?
Why modulus by 3?
we are taking mod with 3 because
All the numbers are present thrice except for one number which is only present once.
so every bit is also come thrice except the bits of one numbers
so we we add bits and take mod with 3
then all bits which occurs thrice get cancel (3%3=0) and only those bits left which are of unique no
if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like : and don’t forgot to mark doubt as resolved
1 Like