> For the complete documentation index, see [llms.txt](https://851958789.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://851958789.gitbook.io/notes/0338_counting_bits/slt.md).

# Solution1

* odd number ends with 1
* even number ends with 0

if n is odd: bits of n is one more then bits of n-1 e.g. 3-011 2-010 elif n is even: bits of n is same as bits of n // 2, just emagine left shift out that 0, 1's count remain same.
