Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(startingYield){
  2.     let daysMineOperated = 0;
  3.     let totalAmountOfSpice = 0;
  4.     while(startingYield>=100){
  5.         daysMineOperated++;
  6.         totalAmountOfSpice +=startingYield-26;
  7.         startingYield-=10;
  8.     }
  9.     totalAmountOfSpice>25?totalAmountOfSpice-=26:totalAmountOfSpice=0;
  10.     console.log(`${daysMineOperated}`);
  11.     console.log(`${totalAmountOfSpice}`);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement