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