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