Skip to content

Latest commit

 

History

History
7 lines (4 loc) · 395 Bytes

README.md

File metadata and controls

7 lines (4 loc) · 395 Bytes

Bit Counting

This is a kata from CodeWars (https://www.codewars.com/kata/526571aae218b8ee490006f4)

They wanted you to take an integer, assuming that it's always above zero, convert it to binary, and then count how many "1"s there are in the result.

I had to Google how to convert an integer to binary and found the Convert.ToString() method. I then used RegEx to count the number of "1"s.