Codewars – Bit Counting solution
In this article, I’ll explain how to solve the Bit Counting algorithm challenge on Codewars. Problem statement: Given a 32-bit signed integer, how many set bits are there? Ex: The number 15 has four bits set. Approach How do I know if a bit is set? A bit can either be 0 or 1. A … Read more