* feat: add pop-count practice exercise * config: del house, protein-trans from syllabus As pop-count was added to the loop concept, house and protein translation were removed to keep the tree lean. * Update config.json On second (and third) thought, let's put pop-count first -- ahead of saddle points and OCR. Feels like a better progression that way. --------- Co-authored-by: BethanyG <BethanyG@users.noreply.github.com>
7 lines
146 B
Python
7 lines
146 B
Python
def egg_count(display_value):
|
|
eggs = 0
|
|
while display_value:
|
|
eggs += display_value % 2
|
|
display_value //= 2
|
|
return eggs
|