Recursion and Dynamic Programming - Cow

A cow gives birth to a cow a year, and a newly born cow can also give birth to a cow a year after three years of growth, assuming it doesn't die. Find the number of cows after N years.

If each cow can only live for 10 years, find the number of cows after N years.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325067401&siteId=291194637