just ceil the number instead of regenerate

otherwise it will infinitely loop
no need to subtract purchase each time
the course introduction is wrong

when the next upgrade is not available, should not break out of the
loop, instead should call wait and then break. i.e. use up the
remaining time
complete cheap and expensive strategy

seems like the “dictionary” way is not so faster than the “traverse”
way
modify expensive function
complete best function