#c++
Where is the problem with this function?I only got 50% of the test cases passed.
@Acer
I think shrik3's solution is the most efficient -- shift right, use the LSB (least significant bit), mask with "1", then no need to test/compare since the result of the mask is all ready to add to the count.
Good job shrik3!
Trying to think of applications of that function... error detection, image processing, and maybe signal processing? I don't know...
QOTO: Question Others to Teach Ourselves An inclusive, Academic Freedom, instance All cultures welcome. Hate speech and harassment strictly forbidden.
@Acer
Trying to think of applications of that function... error detection, image processing, and maybe signal processing? I don't know...