C# (Visual C# Interactive Compiler), 4343 38 bytes
Golfed Try it online!Try it online!
i=>Convert.ToString(i,2).CountSum(c=>c>48c=>c)%2<1
Ungolfed
i => Convert.ToString( i, 2 ).CountSum( c => c > 48 ) % 2 < 1
Full code with tests
Func<Int32, Boolean> f = i => Convert.ToString( i, 2 ).CountSum( c => c > 48 ) % 2 < 1;
Int32[] testCases = { 3, 11, 777, 43, 55 };
foreach( Int32 testCase in testCases ) {
Console.Write( $" Input: {testCase}\nOutput: {f(testCase)}" );
Console.WriteLine("\n");
}
Console.ReadLine();
Releases
- v1.1 -
-5 bytes- ReplacedCounttoSum - v1.0 -
43 bytes- Initial solution.
Notes
- None