Skip to main content
2 of 2
Chop 1 char by removing quotes and using 49 to represent '1'

C# 38 bytes

Convert.ToString(X,2).Count(C=>C==49);
sbecker
  • 111
  • 3