1. dp[i][1~3] = i번째 집에 Red or Green or Blue를 칠할 때 드는 비용.
2. 이웃한 집에는 같은 색을 칠할 수 없고, N번째 집까지 칠했을 때 최소 비용을 구한다.
주의할 점
1. dp라는 배열을 이용해서 바로바로 저장하면서 값을 구할 수 있다.
2. 이웃한 집의 색은 이전 집만 겹치지 않게 구현한다면 결과적으로 양 옆으로 겹치지 않게 된다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters