1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-11-08 18:49:07 +01:00
CodeWars/6kyu/bouncing_balls/solution.py
Matej Focko fc899b0b02
chore: initial commit
Signed-off-by: Matej Focko <mfocko@redhat.com>
2021-12-28 16:19:58 +01:00

9 lines
214 B
Python

def bouncingBall(h, bounce, window):
if h <= 0 or (bounce <= 0 or bounce >= 1) or window >= h:
return -1
result = -1
while h > window:
h *= bounce
result += 2
return result