Advertisement
Mvelchev

Untitled

May 29th, 2022
940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(startingYield){
  2.  
  3.     let totalAmount = 0;
  4.     let daysCount = 0;
  5.  
  6.     while(startingYield >=100){
  7.         daysCount++;
  8.         totalAmount += startingYield - 26;
  9.         startingYield -=10;
  10.     }
  11.         console.log(daysCount);
  12.    
  13.     if (daysCount !== 0){
  14.         console.log(totalAmount-26);
  15.     } else {
  16.         console.log(totalAmount);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement