1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-10-18 10:42:08 +02:00
CodeWars/6kyu/bouncing_balls/solution.py

10 lines
214 B
Python
Raw Normal View History

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