프로그래머스 - 덧칠하기
·
Algorithm/programmers
import Foundationfunc solution(_ n:Int, _ m:Int, _ section:[Int]) -> Int { var list = section var count = 0 while !list.isEmpty { let removed = list.removeFirst() while !list.isEmpty && list.first! - removed