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