about | help | code help+videos | done | prefs |
vampireApocalypse
Vampires can each convert v people a day into vampires. However, there is a band of vampire hunters that can kill k vampires per day. If a coven of vampires starts with vampires members, how long before a town with a population of people becomes a town with no humans left in it? Write a function vampireApocalypse(v, k, vampires, people) that returns the answer to this question. vampireApocalypse(2, 0, 1, 100) → 5 vampireApocalypse(2, 0, 1, 7000000000) → 21 vampireApocalypse(3, 2, 5, 100) → 3 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy