Dp---wine problem

someone plz explain how to fill upper half of 2-d array video is not clearly uploaded…mainly sliding window part

Hey @riprogerdep
I’ll forward your concern to the team. Till then please use this tutorial https://www.geeksforgeeks.org/maximum-profit-sale-wines/.

If your doubt is resolved please mark it as closed.

but i am unable to understand how to fill upper half of the matrix

What do you mean by upper half ?

upper half of left diagonal

In this question dp(i,j) is same as dp(j,i) since the content of subarray(i,j) remain same. So you need to fill only lower half triangle.