function solution(number) { const text = ["수", "박"]; let answer = ""; for (let i = 0; i < number; i++) { answer += text[i % 2]; } return answer; } console.log(solution(3)); console.log(solution(4));