Search
Duplicate

덧칠하기

문제 설명 및 제한사항

아이디어 및 해결 방법

코드

def solution(n, m, section): start, end = None, None cnt = 0 for idx in section: if start is None or not (start <= idx < end): cnt += 1 start, end = idx, idx + m return cnt
Python
복사

출처

프로그래머스 코딩테스트 연습 https://school.programmers.co.kr/learn/challenges