id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

timesDoubling


Bacteria in a container are doubling every few minutes through a process called binary fission. Given an initial number of bacteria startingNum and a maximum number of bacteria that can fit in the container maxNum, return the amount of times the colony of bacteria can double before the container is full or will not have space for another full fission.


timesDoubling(1, 7) → 2
timesDoubling(42, 23981094) → 19
timesDoubling(5, 500) → 6

...Save, Compile, Run (ctrl-enter)

public int timesDoubling(int startingNum, int maxNum){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 300

Copyright Nick Parlante 2017 - privacy