[Programmers] 덧칠하기
Python
def solution(n, m, section):
answer = 1
paint = section[0] + m - 1
for i in section:
if i > paint:
paint = i + m - 1
answer += 1
return answer
def solution(n, m, section):
answer = 1
paint = section[0] + m - 1
for i in section:
if i > paint:
paint = i + m - 1
answer += 1
return answer
댓글남기기