Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function buildAWall(wall) {
- wall = wall.filter(x => x !== 30);
- let cubicPerDay = [];
- let wallPrice = 0;
- while (wall.length !== 0) {
- cubicPerDay.push(wall.length * 195);
- wallPrice += cubicPerDay[cubicPerDay.length - 1] * 1900;
- for (let i = 0; i < wall.length; i++){
- wall[i]++;
- }
- wall = wall.filter(x => x !== 30);
- }
- console.log(cubicPerDay.join(', '));
- console.log(`${wallPrice} pesos`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement