Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function exercise(input) {
- input = input.map(Number).filter(x => x < 30);
- let concreteEachDay = [];
- let amount = 0;
- while (input.length > 0) {
- let cubucsPerDay = 0;
- input.forEach(x => cubucsPerDay += 195);
- input = input.map(x => x += 1).filter(x => x < 30);
- concreteEachDay.push(cubucsPerDay);
- amount += cubucsPerDay * 1900;
- }
- console.log(concreteEachDay.join(", "));
- console.log(`${amount} pesos`);
- }
Advertisement
Add Comment
Please, Sign In to add comment