Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(startingYield) {
- startingYield = Number.parseInt(startingYield);
- let days = 0;
- let total = 0;
- while(startingYield >= 100) {
- days++;
- total += startingYield;
- startingYield -= 10;
- total -= 26;
- }
- total -= 26;
- if (total < 0) {
- total = 0;
- }
- console.log(days);
- console.log(total);
- }
- solve(111);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement