mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-11-09 11:09:07 +01:00
9 lines
214 B
Python
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
|