Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(year, holidays, weekends) {
- let weekendsInSofia = 48 - weekends;
- let saturdaySofiaGames = (weekendsInSofia * 3.0) / 4;
- let gamesInBornTown = weekends;
- let gamesInHolidays = (holidays * 2.0) / 3;
- let totalGamesWeekends =
- saturdaySofiaGames + gamesInBornTown + gamesInHolidays;
- if (year == "normal") {
- console.log(Math.floor(totalGamesWeekends));
- } else if (year == "leap") {
- totalGamesWeekends *= 1.15;
- console.log(Math.floor(totalGamesWeekends));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement