You are given two 0-indexed integer arrays,
cost
andtime
, of sizen
representing the costs and the time taken to paintn
different walls respectively. There are two painters available:
- A paid painter that paints the
ith
wall intime[i]
units of time and takescost[i]
units of money.- A free painter that paints any wall in
1
unit of time at a cost of0
. But the free painter can only be used if the paid painter is already occupied.Return the minimum amount of money required to paint the
n
walls.
c++
1 |
|