There are multiple blocks of varying sizes. The job is to paint the blocks. Below are the constraint:
For eaxmple:
[4,4,4,4] ->. This take 4 unit of time hence the output it 4
[5,1,2,3] -> This takes 1 unit to paint 1 unit of all 4 blocks+(4 units of 1st block+2 units of last two blocks)+1 units of last block ==> 8