Hi folks! In the last LUG--- atm of this writing, there was a discussion around having community events, and algos and CTFs were enthusiastically proposed. The idea was to have our community hack on something together on (this past) Sunday, but that unfortunately never came to be--- I guess people did not get the bandwidth. That withstanding, I had volunteered to take up posting an algo problem every other week as we figure out how to make these community events more practical; so here we are!
I'll be scavenging for cool algos, CTFs and post them as weekly challenges. Let's see how this goes(I really hope I can keep this up!)
Let's take this as an opportunity to:
- explore new lang features (I've learnt quite a bit about GUILE this way, and I hope to do so with Rust);
- get some form of intellectual stimulation;
- see how other LUGers think;
- prep for interviews in an enjoyable fun way; and
- <insert your awesome reason here>
PS: If you have any cool suggestions, feel free to reach out to me on mail :)
Issue 0 - Hamming Weight
Source: https://is.gd/lR9u7I
Write a function that takes an unsigned integer and returns the number of "1" bits it has.
Examples:
Input: n = 00000000000001011
Output: 3
Input: n = 0000100000
Output: 1
Input: n = 11111111110
Output: 10
Post your solutions as comments to this gist