Python
Python copied to clipboard
feat: add count_bits algorithm with doctests
Summary
This PR adds a new bit manipulation algorithm count_bits that returns the
number of set bits (1s) in a non-negative integer.
Highlights
- Pure Python bitwise implementation
- Includes doctests following project standards
- Validates against negative input
- No external dependencies
Checklist
- [x] Doctests added
- [x] Code follows repository format
- [x] No breaking changes
Thank you!