More Bit Hacking Fun:
If you would like to explore more about bit hacking, I recommend these resources to get you started:
» Low Level Bit Hacks You Absolutely Must Know
» Bit Twiddling Hacks
The first one is beginner-friendly, and teaches you the basic but useful bit hacks you encounter often. The latter one is more difficult and has quite some clever bit hacks. Some of the bit hacks contain just one line of code, which is amazing.
EDIT: (More Bit Twiddling Fun)
Try this question from Google CodeJam 2010 for more bit twiddling fun.
» Google CodeJam 2010 Qualification Round Problem A: Snapper Chain
Read full article from Number of 1 bits | LeetCode
No comments:
Post a Comment