function solution(n) {
var answer = Array(Math.floor(n / 2))
.fill("수박")
.join("");
return n % 2 !== 0 ? answer + "수" : answer;
}
Level
프로그래머스 Lv1
Recruitment
function solution(n) {
var answer = Array(Math.floor(n / 2))
.fill("수박")
.join("");
return n % 2 !== 0 ? answer + "수" : answer;
}