A ball is dropped from height centimetres. After every bounce it rises back up to half its previous height, rounded down (integer division). Write bounces(height, min_height) that counts how many bounces rise to at least min_height centimetres. A bounce that rises to less than min_height is not counted, and the ball stops there.
Examples
Input: height = 100, min_height = 10
Output: 3
Explanation: bounces rise to 50, 25, 12 (three counted); the next would only be 6.
Input: height = 5, min_height = 10
Output: 0
Constraints
0 <= height <= 10**91 <= min_height <= 10**9
Goals
- Use a while loop that stops when a value becomes too small
- Count the number of iterations a simulation takes