Bottom up approach for the Wines Problem

I had a fair idea about the top down approach, but I wanted to see how would we implement the bottom-up approach, particularly filling up the matrix diagonally. Can you please share me the optimal way we can fill the 2D array diagonally. I utilize the concept of ‘gap’ between the row and the column indexes. Initially gap = 0 and it increases to n-1 in the end. I write it this way:

for(int gap = 0; gap < n; gap++) {
    int year = n - gap;
    for(int row = 0; row < n - gap;  row++) {
      dp[row][row+gap] = ......
   }
}

Can you please tell me what would be a better approach ?