Last active
March 10, 2016 01:13
-
-
Save julien-sarazin/572e9730dd662a2a7bec to your computer and use it in GitHub Desktop.
Solution for Binary String.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function countPosBits(input){ | |
return isNaN(input) ? 0 : parseInt(input).toString(2).replace(/0/g, '').length; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment