📌 문제
https://programmers.co.kr/learn/courses/30/lessons/12922
📌 접근
📌 코드
python
def solution(n):
answer = ''
s = n//2
answer = "수박"*s
if n%2 == 1 :
answer += "수"
return answer
js
function solution(n) {
var answer = '';
let s = parseInt(n/2)
answer = "수박".repeat(s)
if( n%2 == 1)
answer += "수"
return answer;
}
✍ 메모