Money grows by a different factor each year: 1.5 means +50%, 0.5 means −50%. Write average_growth(factors): one yearly factor that stands for all the years.
$100 grew 50% one year and shrank 50% the next. Your function gets each year’s growth factor and hands back one factor for a typical year.
type a factor to try a typical year
average_growth(factors)| factors | one per year, e.g. [1.5, 0.5] is +50% then -50% | e.g. [1.1, 1.1, 1.1] |
| returns | one yearly factor that stands for all the years | |