Simple DP without color comparation
Intuitioncolor house by pairs <#j, #(n−1−j)>
there are 6 choices of color pairApproachuse a 2D-list to store color pairs
the possible adjacent color pair is fix
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
color house by pairs <#$j$, #$(n-1-j)$>
there are 6 choices of color pair

# Approach
<!-- Describe your approach to solving the problem. -->
use a 2D-list to store color pairs
the possible adjacent color pair is fixed, so we expand them by 6 possibilities

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
$O(n)$
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
$O(1)$
# Code
```python3 []
class Solution:
    def minCost(self, n: int, cost: List[List[int]]) -> int:
        cols = [[0,1],[0,2],[1,0],[1,2],[2,0],[2,1]]
        dp0 = [0] * 6
        dp1 = [0] * 6
        for i, colp in enumerate(cols):
            dp0[i] = cost[0][colp[0]] + cost[n-1][colp[1]]
        
        for j in range(1, n // 2):
            dp1[0] = min(dp0[2],dp0[3],dp0[4])
            dp1[1] = min(dp0[2],dp0[4],dp0[5])
            dp1[2] = min(dp0[0],dp0[1],dp0[5])
            dp1[3] = min(dp0[0],dp0[4],dp0[5])
            dp1[4] = min(dp0[0],dp0[1],dp0[3])
            dp1[5] = min(dp0[1],dp0[2],dp0[3])
            dp0 = dp1
            dp1 = [0] * 6
            for i, colp in enumerate(cols):
                dp0[i] += cost[j][colp[0]] + cost[n-1-j][colp[1]]
            
        
        return min(dp0)

```
['Python3']