Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @timeit
- def bouncing_ball4(h, bounce, window):
- if h != 0 and 0 < bounce < 1 and window < h:
- count = 1
- current = h * bounce
- while current > window:
- current *= bounce
- count += 2
- return count
- else:
- return -1
- print(bouncing_ball4(9223372036854775807, 0.999999, 1))
Add Comment
Please, Sign In to add comment