
프로그래머[JS] > 서버 증설 횟수
·
🔒Algorithm
문제https://school.programmers.co.kr/learn/courses/30/lessons/389479 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr풀이시간대별로 현재 서버갯수를 파악할 수 있는 servers Array를 생성하고 시간대별 유저수를 탐색하면서 증설해야되는 서버가 필요 시 이를 servers에 추가하면서 증설횟수를 카운트 하여 답을 구할 수 있었다. function solution(players, m, k) { let servers = Array(24).fill(0); let answer = 0; players.forEach((playerCnt, sTime..