primeiro commit com exercicios de Exercism realizados até esta data

This commit is contained in:
2026-10-17 22:10:27 +01:00
commit 58fccbe27a
708 changed files with 35038 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
def egg_count(display_value):
number_of_eggs: int = 0
weight: int = 1
while display_value % weight != display_value:
weight *= 2
while display_value:
if display_value == weight:
number_of_eggs += 1
display_value -= weight
if display_value < weight:
weight //= 2
continue
if display_value % weight:
number_of_eggs += 1
display_value -= weight
weight //= 2
return number_of_eggs