How to deal with question related to bitwise operator

In general i have trouble with solving with questions which relates to bitwise operation.
As each of have their own way to approach.
Can you suggest how to at least proceed to find a pattern or to get a lead.

1 Like

This HackerEarth tutorial along with practice problems is helpful.

What i am asking is how to approach a problem. As most of the time it’s some pattern or mathematical expression gets involved in editorial.
And what you shared was how to manipulated bits.

I would like to help you, but I think I can’t see what you are looking for in an answer to your question. The obvious answer is that one way (maybe the only way!) to approach is to think of the items (numbers, strings or whatever) as a set of elements that can take one of only two values, and each element can be transformed individually or in binary operations with another element by means of a set of operations that follow Boolean logic.