{"size": 1445, "ext": "js", "max_stars_repo_path": "JS-Fundamentals/Exam - 11 Feb 2018/02. Air Pollution.js", "max_stars_repo_name": "sevgin0954/SoftUni-Projects", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "JS-Fundamentals/Exam - 11 Feb 2018/02. Air Pollution.js", "max_issues_repo_name": "sevgin0954/SoftUni-Projects", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "JS-Fundamentals/Exam - 11 Feb 2018/02. Air Pollution.js", "max_forks_repo_name": "sevgin0954/SoftUni-Projects", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.7884615385, "max_line_length": 68, "alphanum_fraction": 0.4332179931}
function trackpollutionInTheAir(mapMatrix, forces) {
    let map = [];

    for (let a = 0; a < mapMatrix.length; a++) {
        map[a] = mapMatrix[a].split(' ').map(Number);
    }

    let actions = {
        breeze: (index) => {
            for (let col = 0; col < map[0].length; col++) {
                map[index][col] = Math.max(0, map[index][col] - 15);
            }
        },
        gale: (index) => {
            for (let row = 0; row < map.length; row++) {
                map[row][index] = Math.max(0, map[row][index] - 20);
            }
        },
        smog: (value) => {
            for (let row = 0; row < map.length; row++) {
                for (let col = 0; col < map[0].length; col++) {
                    map[row][col] += value;
                }
            }
        }
    };

    for (let a = 0; a < forces.length; a++) {
        let forceArgs = forces[a].split(' ');
        let forceName = forceArgs[0];
        let value = Number(forceArgs[1]);

        actions[forceName](value);
    }

    let polutetAreas = [];

    for (let row = 0; row < map.length; row++) {
        for (let col = 0; col < map[0].length; col++) {
            if (map[row][col] >= 50) {
                polutetAreas.push(`[${row}-${col}]`);
            }
        }
    }

    if (polutetAreas.length > 0) {
        console.log('Polluted areas: ' + polutetAreas.join(', '));
    }
    else {
        console.log('No polluted areas');
    }
}