Easy C++ || Memoization Soln
Approach

We will color ( i ) th and ( n-i-1 ) th index simulteneously at the same time.


While painting we should make sure that adjecent houses don't have sa
# Approach
<!-- Describe your approach to solving the problem. -->
- We will color **( i )** th and **( n-i-1 )** th index simulteneously at the same time. 

- While painting we should make sure that adjecent houses don't have same color also Mirror Houses cannot have same color
- **( i , j )** Represents color that we are going to give House and Mirror house respectively




# Code
```cpp []
class Solution {
public:
    long long f(int ind, int prevCol, int prevMirrorCol,
                vector<vector<int>>& cost, int n,
                vector<vector<vector<long long>>>& dp) {
        if (ind >= n / 2)
            return 0;
        if (dp[ind][prevCol][prevMirrorCol] != -1)
            return dp[ind][prevCol][prevMirrorCol];

        long long mini =LLONG_MAX;
        for (int i = 0; i < 3; i++) {
            if (i != prevCol) {
                for (int j = 0; j < 3; j++) {
                    if (i != j && j != prevMirrorCol) {
                        long long price = long(cost[ind][i]) +
                                          long(cost[n - ind - 1][j]) +
                                          f(ind + 1, i, j, cost, n, dp);

                        mini = min(price, mini);
                    }
                }
            }
        }

        return dp[ind][prevCol][prevMirrorCol] = mini;
    }

    long long minCost(int n, vector<vector<int>>& cost) {
        vector<vector<vector<long long>>> dp(
            n + 1, vector<vector<long long>>(4, vector<long long>(4, -1)));
        return f(0, 3, 3, cost, n, dp);
    }
};
```
['Dynamic Programming', 'Memoization', 'C++']