Codewars - Bit Counting - Javascript Solution

Опубликовано: 09 Декабрь 2020
на канале: The Coding Odyssey
2,335
44

In this video we are solving another 6kyu coding challenge from Codewars called Bit Counting using javascript. This is a common problem that can be found on Leetcode as well among other places.

Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of that number. You can guarantee that input is non-negative.

Example: The binary representation of 1234 is 10011010010, so the function should return 5 in this case

Here is the link to the coding challenge.
Codewars - Bit Counting: https://www.codewars.com/kata/526571a...

#bitcounting #bitcountingjavascript #bitcountingalgorithm #bitcountingcodewars #countingbitsleetcode