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