<p>There is a row of <code>m</code> houses in a small city, each house must be painted with one of the <code>n</code> colors (labeled from <code>1</code> to <code>n</code>), some houses that have been painted last summer should not be painted again.</p>
<p>A neighborhood is a maximal group of continuous houses that are painted with the same color.</p>
<p>Given an array <code>houses</code>, an <code>m x n</code> matrix <code>cost</code> and an integer <code>target</code> where:</p>
<ul>
<li><code>houses[i]</code>: is the color of the house <code>i</code>, and <code>0</code> if the house is not painted yet.</li>
<li><code>cost[i][j]</code>: is the cost of paint the house <code>i</code> with the color <code>j + 1</code>.</li>
</ul>
<p>Return <em>the minimum cost of painting all the remaining houses in such a way that there are exactly</em><code>target</code><em>neighborhoods</em>. If it is not possible, return <code>-1</code>.</p>