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