without using extra space

```
def minCost(self, costs):
"""
:type costs: List[List[int]]
:rtype: int
"""
for i in range(1,len(costs)):
costs[i] = [costs[i][j] + min([costs[i-1][k] for k in range(3) if k != j]) for j in range(3)]
return min(costs[len(costs)-1]) if len(costs) > 0 else 0
```